Well, it's been a whirl-wind week for me and my little tic-tac-toe app. This week saw many improvements. Here's the full feature list as it now stands:
Grid sizes:
- 3x3*
- 4x4
Player configurations:
- Human (X) vs. Human (O)
- Computer (X) vs. Human (O)*
- Human (X) vs. Computer (O)
- Computer (X) vs. Computer (O)
Computer AI now has 3 difficulty levels:
- Easy (random)
- Medium (mix of random and minimax)
- Hard (minimax)*
- Terminal UI indicates which cells are available and allows user to select all of the above.
- On top of all that, there's now a GUI implemented with the Quil animation library!
Here's a little demo of the GUI in action:
Supporting 4x4 grids required a major overhaul of the core code and I'm really happy with the result.
I'm only moderately pleased with the GUI code. I guess it wasn't bad for my first real forray into GUI programming with quil, but hardly any of it is covered by automated tests. The state data structure has so much stuff on it, even for this tiny app. The real decision-making happens in the various update functions, which I could cover with tests--there's just a lot of initial state to setup to make that happen. Stay tuned...