Unbeatable tic tac toe implementation