Unbeatable Tic-Tac-Toe

Place three Xs or Os in a row to win: diagonally, vertically, or horizontally.

This AI uses the minimax algorithm and early game hueristics so that it never loses.