The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.34 / 5.00 31,296 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.07 / 5.00 10,082 ViewsI'm quite new to C++ and so I've started a Tic Tac Toe game. It has went good so far but now I am stuck with making a code that checks when you've won.
http://hstuart.dk/pa..87-80f7-1e9b4121f8ac
that's what I've made so far.
Make another function that tests whether someone has won or not and add it to the game loop. Simple as that. It's just going to be a couple of if/then statements.
At 12/11/05 10:16 PM, Ravens_Grin wrote: Make another function that tests whether someone has won or not and add it to the game loop. Simple as that. It's just going to be a couple of if/then statements.
Yeah, that's a way to do it but aren't there practical ways of doing this?
Everytime you put a peice on the board, check to see if there are two more in any other squares that would make a win.
So if you put an X in the top left, see if there is an X in both the top-mid and top-right. If so, win. Also check to see if there is an X in the left-middle and left-bottom. If So. Win. Check to see if there is an Xin the middle-middle, or bottom-left. if So, win. If not. Keep playing. That is, if there is still an open slot, if there isn't, it's a tie.
John Rambo is my hero