This project provides Java implementations of Deep First Search algorithm for generating so called "perfect mazes".
https://igushkin.github.io/maze-client/
The algorithm starts at a given cell and marks it as visited. It selects a random neighboring cell that hasn’t been visited yet and makes that one the current cell, marks it as visited, and so on.
If the current cell doesn’t have a neighbor that hasn’t been visited yet, we move back to the last cell with a not-visited neighbor.
The algorithm finished when there is no not-visited cell anymore.
The algorithm is recursive and might cause memory issues for big mazes.
This application requires JDK 17 to run.
- Dowload the source
git clone https://github.com/igushkin/maze.git
- Build the project by running
mvn clean package
- Execute the JAR file by running:
java -jar target/mvn-example-1.0-SNAPSHOT.jar
- Open client/index.html in the browser