TicTacToe
Friday, May 2nd, 2008 | Programs
For more including Author's Notes download the eBook pages with this program's code listing.
Tic-Tac-Toe is a game that needs no introduction. At some point everyone’s learned a winning strategy for the game. What is learned is that if played properly O will never win at Tic-Tac-Toe, but if O plays properly, neither will X. As a computer game, however, this strategy isn’t much fun. Who wants to play a computer if you can never beat it, or worse, if you can find and exploit a bug in the game every time.
This version of Tic-Tac-Toe isn’t like that. This version starts as a clean slate, like you the first time you learned, with only the basic rules of (1) take the win if you can and (2) block if you have to. Every game it plays it remembers and it remembers how the game ended. Even if you beat it when you were X, when it gets a turn to play X you may begin to see your own moves used on you. If the computer starts winning you’ve got no one to blame but yourself.
2 Comments to TicTacToe
Great illustration!
July 10, 2008
It’s one of my favorates and I seriously think I over thought it. See, the O can never win, but can play defensively (hence the shield). However, if X trips up O’s got a killer mace. Slow but deadly.
It’s one that I’d almost like to put on a Tee Shirt.
Leave a comment
Subscribe
Support Cymon's Games
Recent Comments
- Bill on Numbrix
- Joe on Should I do tutorials?
- Alan Monroe on Should I do tutorials?
- Alan Monroe on Should I do tutorials?
- Peter on StarTrek
- Joe on Others Teaching Programming
- Devin Watson on Others Teaching Programming
- Joe on Programming Math
















July 10, 2008