-
Help designing the AI in tictactoe
can anyone help me think of the AI of tictactoe done in MFC. i know my base
case should be that if the player won, or if all the cell are occupied then
return then as for the general case i should check each move... then move
the computer to that move. is this algorithm right??? if not can anyone give
me an idea on what factors i should consider and stuff...
anyways, thank you for your advice in advance
John
-
Re: Help designing the AI in tictactoe
this is not really ai, but just create a positions table (rotate to reduce
to just a few cases) and point to the next best move. This includes draws
and wins.
IF you can't do this (not allowed that is) then do what you said. First
see if its a win, then see if all done (draw). Do this after either side
moves! For computer moves, you should search for a block of opponent win
or dual (the place where if he goes there, he can win 2 ways and you can
only block one). Block this, else find a dual for the compuer or a win for
it.
"John Cruz" <Baller187_69@hotmail.com> wrote:
>
>
> can anyone help me think of the AI of tictactoe done in MFC. i know my
base
>case should be that if the player won, or if all the cell are occupied then
>return then as for the general case i should check each move... then move
>the computer to that move. is this algorithm right??? if not can anyone
give
>me an idea on what factors i should consider and stuff...
>anyways, thank you for your advice in advance
>
>John
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks