Update the Maze Class
Now, you only need to import one symbol from the
maze_solver package to work with mazes stored in files. The deserialized object’s attribute values confirm that you successfully loaded the maze.
You can also check if you correctly guessed which squares are the entrance and exit of the miniature maze. So with that in place, why not go ahead and try loading a more challenging maze from the supporting materials? For example, the
labyrinth.maze has 896 squares arranged in 32 rows and 28 columns.
You can preview it in your web browser by running the code seen on-screen in the REPL. Make sure that you specify the right path to the file and run the code from a virtual environment that has the
maze_solver package installed.
02:50 Can you find the way out to this maze by looking at it? While there are no enemies, the maze is still quite tricky. It would, of course, be better to get Python to solve this maze and indeed any others you have stored in your binary format.
Become a Member to join the conversation.