From ae3b0759cb3ebeba008b3e9c7b6e3e3c055995ba Mon Sep 17 00:00:00 2001 From: Josh Creek <8179928+jcreek@users.noreply.github.com> Date: Wed, 24 Dec 2025 12:09:36 +0000 Subject: [PATCH] fix(*): Fix bug where mazes were not reset --- mazes.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mazes.py b/mazes.py index 588afc2..4cd3bf4 100644 --- a/mazes.py +++ b/mazes.py @@ -83,6 +83,16 @@ direction_index = 0 treasure_not_yet_found = True +def reset_state(): + global visited_cells + global path_back + global direction_index + global treasure_not_yet_found + + visited_cells = {} + path_back = [] + direction_index = 0 + treasure_not_yet_found = True def record_current_cell_visited(): visited_cells[(get_pos_x(), get_pos_y())] = get_entity_type() @@ -190,6 +200,9 @@ def backtrack_one_step(): def navigate_maze(): global treasure_not_yet_found + + clear() + reset_state() plant_maze() record_current_cell_visited()