def get_action(self, state: GameState, connection): # TODO: Doc options = state.get_valid_actions()[:] for option in options: new_state = state.apply_action(option, self.other_type) is_term, winner = new_state.is_terminal() if is_term and winner > 0: return option new_state = state.apply_action(option, self.type) is_term, winner = new_state.is_terminal() if is_term and winner < 0: return option choice = random.choice(options) return choice
def get_action(self, state: GameState, connection): # TODO: Doc options = state.get_valid_actions() choice = random.choice(options) return choice