The
Regulars
Blog
My Xanga
Old Stuff
The Road Not Taken
Spiritual Blessings
OTHER SITES
John's Page
Lam's Page
Pisces6 Page
Virginia's
Page
Dad's Work Page
Dave McGuire's Page
Mary's Hats Page
Dave Lai's Page
Morgan Chen's Page
Our 184 Water Project
Emmanuel's Site
Related Links
|
|
download tic-tac-toe.exe
view the source
My Tic-Tac-Toe search engine uses a negamax search
algorithm to determine the best possible sequence of moves to
play. What this means is it searches every branch in the tree of
possible positions, where branches terminate at a decisive
position. It can be assumed that the player who's turn it is to
move will pick the most advantageous move at each position. So the
computer picks the score of the move that best helps the player to move,
and returns it up the tree.
DIRECTIONS:
1) Click on download tic-tac-toe.exe, then click open.
2) You will see some text followed by "the computer moves
0". Typing one of the numbers 1-9 will fill a square on the
board. By typing "0", you pass the turn to the computer.
3) After you enter your move, the board will be displayed.
You are the 1's, the computer is the 2's. The computer will tell
you its move and redisplay the board.
4) Repeat this until the game is over. Right now the program
exits after a win, loss, or draw.
5) Also, be kind, there is no error checking so its pretty easy to
mess things up.
|
|
|