Tic-Tac-Toe is an easy game to play. There are 19,683 possible board layouts (39), and 362,880 (i.e. 9!) possible games. This square shown below is a magic square for Tic-Tac-Toe game because all the rows, columns and diagonals sum to 15.
WINNING CONDITION:
If the total of all the entries in one row gets to 15, player is declared winner.
POSSIBLE WIN:
Compute the difference between 15 and two squares of a pair. If its not positive or if it is greater than 9, then these squares can be ignored. Otherwise, if the difference is equal to the remaining square of that row then the next move there will produce a win.


Comments
Post a Comment