This was my first foray into writing game-playing AIs. tic-tac-toe was a good introduction, since it is such a simple game. This program uses the minimax algorithm to play a perfect game of tic-tac-toe. It is not possible to defeat it. Features include the ability to play as X, O, or both (solo play). It also has an "undo" move feature.
You know how to play tic-tac-toe, c'mon! Just click in the appropriate cell to make a move.