Thursday, January 24, 2013

Refactoring

I spent a lot of today refactoring my Tic Tac Toe program. There's something very satisfying about optimization. Most of what I did was to make it easier to implement the controls that will select what kinds of players are added to the game. The player and ai are now the same class. The difference is in what strategy they use to make their moves. A human will use an input strategy. An ai player uses a dumb strategy or negamax. There could be other strategies in the future. Things were going smoothly until I got to adding the new code. Then I stalled. I know what I need to do, but I'm having trouble taking the first steps. With everything that I've learned so far, this means that I'm trying to take too big of a step. Hopefully I can work this out tomorrow.

No comments:

Post a Comment