Just remove complete since it's actually not needed. We can stop the maze once find_coord doesn't find anything new.

master
Zed A. Shaw 1 week ago
parent 8a6d231565
commit 42df3961fc
  1. 8
      phase_six.py

@ -73,13 +73,6 @@ class Map:
result.append([x,y])
return result
def complete(self, grid):
for y in range(1, self.height, 2):
for x in range(1, self.width, 2):
if(grid[y][x] != SPACE):
return False
return True
def hunt_and_kill(self, grid):
on_x = 1
on_y = 1
@ -105,7 +98,6 @@ class Map:
grid[row][col] = SPACE
on_x, on_y = nb_x, nb_y
assert self.complete(grid), "Maze is not complete."
return dead_ends

Loading…
Cancel
Save