Skip to content

Instantly share code, notes, and snippets.

@sposterkil
Created September 13, 2013 22:17
Show Gist options
  • Save sposterkil/6556815 to your computer and use it in GitHub Desktop.
Save sposterkil/6556815 to your computer and use it in GitHub Desktop.
Mouse instance named Despereaux, because literary references.
else:
despereaux = Mouse(initial_cell)
done = False
visited_cells = []
route = MazeRoute()
while (despereaux.can_travel() and
not despereaux.current_cell in visited_cells):
if despereaux.current_cell in self._cells:
visited_cells.append(despereaux.current_cell)
else:
route.add_cells([])
return route
route.add_cells(visited_cells)
return route
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment