Tic Tac Toe misery

Well a few days back I started working on a code for a simple tic tac toe game in C++ entirely. The game is supposed to feature very good computer AI.

I am doing logical part and a dear friend of mine, Haritosh, is doing GUI and presentation of the game. Spent two days discussing the idea and the algorithms, finally got down to coding. After another two sleepless nights, I completed the code. When compiled gave me 25 errors, I was shocked.
Well, another day was spent in correcting those errors. When project seemed nearly finished , i decided to play a dummy game. When run , it started giving unimaginable logical errors (some of them like both u and computer have won the game). Enough of this brotherhood, I decided to give more of my precious time to this. So 2 days have already passed and I have removed most of the logical errors but the biggest one remained. The game carried on even after someone wins. I was frustated to death then Haritosh(the had already finished the GUI) came to my rescue and pointed out the error.
I was using character array but in the func for checking the winner and terminating the game, i had used integer array in parametres. So, it was converting char array to int array and was acting bizarrely. Finally after this much debugging, i am ready to complete it by a day or two. And had a good night's sleep yesterday.

0 comments:

 
Copyright © PRATIK ANAND's weblog.