A C++ terminal application that implements Wilson’s Algorithm for generating perfect mazes — mazes with exactly one unique path between any two cells.
- Start with a grid of walls (
#). - Choose one random cell and mark it as part of the maze.
- Pick another random cell not in the maze.
- Perform a random walk until the walk touches the existing maze.
- If a loop forms during the walk, erase it (loop erasure).
- Convert the walk’s cells into maze passages (
' '). - Repeat until every cell is part of the maze or a "wall".
This produces a perfect maze — every cell is reachable, and no cycles exist.
- make (builds executable)
- make clean (removes the executable)
- make run (runs executable)
Wilson_Algo/
├── main.cpp # Core implementation of Wilson's algorithm
├── Makefile # Build commands
├── README.md # Project documentation
└── .gitignore # Ignore build artifacts
