tictactoe terminal game with minmax AI