


Needs a bit of work.
You are welcome to use my formula for unbeatable TIC-TAC-TOE.
Computer always goes first, in center. Label boxes from the top-left:
1, 2, 3
4, X, 6
7, 8, 9
Then when computer moves have it follow this table:
2, 1, 6
7, X, 3
4, 9, 8
So - if the player goes to square 4, then computer goes to 7.
Plays an unbeatable game and no need to even check if squares are already filled when computer moves. Just look for valid win.
Hope This Helps !



"Unbeatable" isn't fun, though. The trick is to make it challenging and competent, but not totally unbeatable.



It's just a formula, Tony. Looking at the source - he (she?) might not know how to write one that schemes and plans moves ahead.
Still - that is definitely something to learn. Get that brain a-going ! :)
[Please log in to post a comment]