Aunsiels / alphazero_janggi

4 stars 0 forks source link

input validation #2

Closed boardgame1 closed 2 years ago

boardgame1 commented 2 years ago

In game.py run_game function please add input validation routine.

        if self.current_player == human_player:
            print(self.round, end=' ')
            actions = self.get_current_actions()
            while True:
                new_action = self.get_next_action()
                if new_action in actions or\
                        (new_action.x_from==new_action.x_to and new_action.y_from==new_action.y_to):
                    break
                else:
                    print("Invalid Action")
        else:
            new_action = self.get_next_action()
Aunsiels commented 2 years ago

Hello,

Thank you for your suggestion. It was implemented in commit 5884af5bd94aaade2d078528233349fe2f4205d3