TicTacToe is a project mainly written in Java, it's free.
Unbeatable Tic Tac Toe
Tic Tac Toe game where the computer cannot lose.