Check out my implementation of Tic Tac Toe. I had fun with this one, even though I had to change my methodology several times. I finally settled on a method based on a heuristic implementation. I do over-ride the heuristics if the computer makes the first move since the strict heuristics had it take the center position instead of a corner and this allows the human player additional moves playing to a draw, instead of the computer winning. Other than that one change, I let the heuristics do their thing, which really simplifies the code as it only has the one edge case.
The game is on Github, at: