minimax implementation tictactoe