|
Red Squirrel Reflections
Dave Hoover explores the psychology of software development
|
[Previous entry: "Pair Programming Power"] [Main Index] [Next entry: "Systemic Change"]
Unbeatable Tic Tac Toe
Monday, February 2, 2004
One of the companies I am interested in working for asked me to code an unbeatable tic tac toe game. I chose to code it in Java and it turned out to be a lot of fun. I got a little carried away and developed a Swing GUI on top of the text UI they had required. It gave me an excuse to play with Threads again. I really like Threads. And the nice thing about Swing is that I can add my main JPanel to a JApplet and wham-o ... the game is available on the web ... in one line of code.
Once I was finished with the game, I started Googling unbeatable tic tac toe. Looking at the source code for some other tic tac toe games, I am grateful that I had the power of object-oriented design and test driven development at my disposal ... they saved me from having to think about too many things at once.
Powered by Greymatter