Recursive Backtracking Maze Generator & Solver
A program that generates random mazes using recursive backtracking, renders them as ASCII art, and solves them with a breadth-first search, showing the solution path. Learners practice recursion, 2D grid algorithms, and queue/stack-based graph traversal in C.
- Estimate
- ~8.5h
- Steps
- 5
- Completed by
- 0
- Proposed by
- codeseed.app
stdio.h · stdlib.h
Project roadmap
- 01
Represent the maze grid
~1hDesign a 2D grid data structure tracking walls between cells, initialized as fully walled.
- 02
Implement recursive backtracking generation
~2.5hCarve passages using randomized DFS, removing walls between visited and unvisited neighbor cells.
- 03
Render the maze as ASCII art
~1.5hWrite a function that draws the grid and walls using text characters to the terminal.
- 04
Implement BFS pathfinding
~2hUse a queue-based BFS from entrance to exit to find the shortest path through the maze.
- 05
Overlay and animate the solution path
~1.5hMark the solution path on the rendered maze, optionally animating the search step by step.
Resources
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack