Maze Generation & Solver - Automatically generate a maze with user inputting size and solve the maze using Breadth-First Search (BFS) and Depth-First Search (DFS).
Input the size for the maze: 10
-------------------------------------------------------------------
+ +---+---+---+---+---+---+---+---+---+
| | | | | |
+---+ +---+ + + + + + + +
| | | | | | | | |
+ + + +---+ + +---+ + + +
| | | | | | |
+ +---+---+ +---+---+---+ +---+ +
| | | | |
+---+ + +---+---+---+ +---+ +---+
| | | | | |
+ +---+ + +---+ +---+ + + +
| | | | | | | | |
+ + +---+ + + + + + + +
| | | | | | | | |
+ +---+---+---+ + +---+ + + +
| | | | | | |
+ +---+---+ + + + +---+ + +
| | | | | | | |
+---+ + +---+ + +---+ +---+ +
| | | |
+---+---+---+---+---+---+---+---+---+ +
String Representation of Generated 10x10 Maze
+ +---+---+---+---+---+---+---+---+---+
| 0 1 | 8 7 9 | | | |
+---+ +---+ + + + + + + +
| 1 | 2 | 5 6 | 0 | | | | |
+ + + +---+ + +---+ + + +
| 0 | 3 4 | 2 1 | | | |
+ +---+---+ +---+---+---+ +---+ +
| 9 5 6 | 3 4 5 6 | | |
+---+ + +---+---+---+ +---+ +---+
| 3 4 | 7 | 6 5 4 | 7 8 | |
+ +---+ + +---+ +---+ + + +
| 2 1 | 8 | 7 | 6 | 1 2 | 9 | | |
+ + +---+ + + + + + + +
| 2 | 0 9 8 | 5 | 0 | 3 | 0 | | |
+ +---+---+---+ + +---+ + + +
| 3 | 8 7 0 1 | 9 | 2 1 | | |
+ +---+---+ + + + +---+ + +
| 4 5 | 8 9 | 2 | 8 | 3 4 | | |
+---+ + +---+ + +---+ +---+ +
| 9 6 7 | 4 3 | 7 6 5 0 1 |
+---+---+---+---+---+---+---+---+---+ +
String representation of DFS Maze
+ +---+---+---+---+---+---+---+---+---+
| 0 1 | 8 7 9 | | | |
+---+ +---+ + + + + + + +
| | 2 | 5 6 | 0 | | | | |
+ + + +---+ + +---+ + + +
| | 3 4 | 2 1 | | | |
+ +---+---+ +---+---+---+ +---+ +
| | 3 4 5 6 | | |
+---+ + +---+---+---+ +---+ +---+
| | | | 7 8 | |
+ +---+ + +---+ +---+ + + +
| | | | | | 9 | | |
+ + +---+ + + + + + + +
| | | | | | 0 | | |
+ +---+---+---+ + +---+ + + +
| | | | 2 1 | | |
+ +---+---+ + + + +---+ + +
| | | | | 3 4 | | |
+---+ + +---+ + +---+ +---+ +
| | | 8 6 5 7 9 |
+---+---+---+---+---+---+---+---+---+ +
String representation of BFS Maze
All parts of Maze Generation & Solver are free to use and abuse under the open-source MIT license.
Maze Generation & Solver was created by Nhat Nguyen and Jasmine Mai.