Im a new programmer and im trying to make a tic tac toe game. I was wandering how to make the AI for it. could someone help me?
Im a new programmer and im trying to make a tic tac toe game. I was wandering how to make the AI for it. could someone help me?
this is fairly simple....
you can represent the board as a 2d 3x3 array
you can take advantage of the fact that there is only 8 ways to win the game. three rows three columns and two diagonals
the really simple tictactoe game will only check for possible wins on those lines and possible losses on those lines else place avatar in random slot... start with this then try to think how to make it more intelligent.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
I didnt see this topic when i posted mine.
I guess the AI for Tic Tac Toe is going to be a function with a TON of if statements. Or at least thats how i plan on doing mine!