Tic Tac Toe Disaster =(

Started by
13 comments, last by Elwren 22 years, 5 months ago
This reminds me the movie "WAR GAMES" performed by Mathew Broderick...those were movies..
Advertisement
Tic-Tac-Toe doesn''t require AI.

Is the computer O, just place in the center :p Immediatly stops the game, noone will win :p
If you actually look into it, you''ll find that the best square to take on the first move is a corner. If the opponent takes any square other than the center, you can beat them. If they do take the center, then you take the opposite corner. At this point, most people think they''re screwed, and will take another corner, allowing you to beat them. But if they take a side, they can force a draw.
Well in an finite game (aka only 9 freaking moves max) you don''t need any learning on part of the computer. SO writing an AI that "learns" in couple of secs is kinda bullshit to me.

Only in games with infinite possiblities (ala chess, movement in a free world) would you need a learning ai that could delevop paterns..

Once in a state science fair I wrote the game othello. (8x8 board) with finite moves and all I did was map out every possible move in a tree and then just selected moves based off that. And the stupid judge couldn''t understand the fact that the computer doesn''t learn anything in this type of game....anyways that''s my little story

Pactuul
-Pac "The thing I like about friends in my classes is that they can't access my private members directly." "When listening to some one tell about their problem (whether it's code or not), don't listen to what went right or wrong, but what they assumed....."
This may be your problem. I only looked at your program for a second.

    void cTurn(int& rRow, int& rCol){	bool fQuitt = false;	while(!fQuitt)	{		srand( (unsigned)time( NULL ) );		int cRow = (rand()%2-0) + 0;		int cCol = (rand()%2-0) + 0;				if(b[cRow][cCol]==0)		{			b[cRow][cCol]=2;			fQuitt = true;			break;		}	}}    


Every time CTurn is called, you set fQuitt to false.

I'm pretty sure fQuitt needs to be TRUE for it to win, right? (I wish I had more time to look at the source)

--Lowell N. Manners
lowell@makevideogames.com
MakeVideoGames.com


Edited by - Lowell Manners on October 24, 2001 12:49:57 PM
--Lowell N. Mannerslowell@makevideogames.comMakeVideoGames.com

This topic is closed to new replies.

Advertisement