def play_game(self, train=True):
        if not train:
            print '\nNew game!'

        self.playerX.start_game()
        self.playerO.start_game()
        while True:
            if self.playerX_turn:
                player, char, other_player = self.playerX, 'X', self.playerO
            else:
                player, char, other_player = self.playerO, 'O', self.playerX

            if player.breed <= "human":
                self.display_board()

            move = player.move(self.board)
            self.board[move - 1] = char

            if self.player_wins(char):
                player.reward(1, self.board)
                other_player.reward(-1, self.board)
                if not train:
                    self.display_board()
                    print char + ' wins!'
                break

            if self.board_full():
                player.reward(0.5, self.board)
                other_player.reward(0.5, self.board)
                if not train:
                    self.display_board()
                    print 'Draw!'
                break

            other_player.reward(0, self.board)
            self.playerX_turn = not self.playerX_turn
dataset/ETHPy150Open zkan/tictactoe/tictactoe_rl.py/TicTacToe.play_game/operator `==` -> `<=`