Hideous, isn't it? Why, thank you! That is, in fact, the point. I want to start with an absolutely hideous piece of code, and add features, re-factoring as I go. It seems to me like there's actually a lot you can do with tic-tac-toe, and so I hope this will turn into something instructive, both for me and for anyone who wants to follow along, and/or contribute.

Feature ideas (in no particular order):

output a real board

game-end condition check

curses-based interface

tic-tac-toe variants

computer can be x or o

two-player mode

tournament mode

web interface

lazy alpha-beta player

random square player

brute-force player

computer vs. computer mode

genetically-evolved players

1/29/2007
Well, the TicTacToe project is now two days old, and it's time to check in on its growth. Here's the newest snapshot of its code:

Well, perhaps 'growth' isn't quite the correct term, since the code has actually shrunk by several lines. Nor has it 'grown' in the features it has, yet. What has happened is that we've used the State monad to get rid of the numerous boards threaded through main. Now there's a single board (which makes good logical sense), which we can access and modify using get, put, and modify. It's still as dumb as a rock, but at least it's a little cleaner!