Added minimax code from tic-tac-toe

Untested