Maze Runner
Write a Python program that builds a 32x32 maze with exactly one guaranteed path, then makes a mouse icon solve it on screen.
Steps
- Set up a 32x32 grid of cells. Give every cell all four walls closed.
- Carve a random maze by knocking down the wall to an unvisited neighbor, then backing up when a cell has none left.
- Mark the top-left cell as a green "Start" square and the bottom-right cell as a checkered "Finish" flag.
- Draw every cell's remaining walls as lines so the maze is visible.
- Find the one guaranteed path from Start to Finish and save it as a list of moves.
- Draw a small mouse icon standing on the Start cell.
- Add a "Start" button. When clicked, it should move the mouse one cell at a time along the saved path.
Stretch Goal
Show a live counter of how many cells the maze generator visited while carving the maze, and another counter for how many steps the mouse takes to solve it.
Advanced Card
Algorithms