diff --git a/snakes/BetterMasterSnake.py b/snakes/BetterMasterSnake.py index 51e3f69..7631759 100644 --- a/snakes/BetterMasterSnake.py +++ b/snakes/BetterMasterSnake.py @@ -128,9 +128,10 @@ class BetterMasterSnake(TemplateSnake): self.find_safe_positions() if self.eat_the_snake_overwrite: if len(self.safe_positions) > 1: - self.add_calculations({"function": "eat_the_snake_overwrite", "my_head": self.my_head, "move": move, "safe_positions": self.safe_positions[0]}) + first_key = list(self.safe_positions.keys())[0] + self.add_calculations({"function": "eat_the_snake_overwrite", "my_head": self.my_head, "move": move, "safe_positions": self.safe_positions, "selected_move": self.safe_positions[first_key]}) self.add_to_history({"turn": game_data["turn"], "data": self.calculations}) - return self.safe_positions[0] + return self.safe_positions[first_key] self.add_calculations({"function": "eat_the_snake_overwrite", "my_head": self.my_head, "move": move, "safe_positions": self.safe_positions}) self.add_to_history({"turn": game_data["turn"], "data": self.calculations})