Solving Tic-Tac-Toe

PGSS Computer Science Core

On Friday 11 July the question came up of how one could use recursion to solve a game (like Tic-Tac-Toe). I deferred the question, but this only means that I'm obligated to give you working code.

The code I wrote does not use a heuristic function. Instead, it solves the entire game tree. I didn't bother attempting to write much of an interface, either.

Anyway, the file is called ``TicTac.java'' and is available on-line. Have fun!