Skip to content
forked from nattui/maze

🌽 Maze Generation & Solver - automatically generates a maze with user inputted size for 2D array. Solves the maze using Breadth-First Search (BFS) and Depth-First Search (DFS).

License

Notifications You must be signed in to change notification settings

jasminemai97/maze

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maze Generation & Solver

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).

Example

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

License

All parts of Maze Generation & Solver are free to use and abuse under the open-source MIT license.

Acknowledgement

Maze Generation & Solver was created by Nhat Nguyen and Jasmine Mai.

About

🌽 Maze Generation & Solver - automatically generates a maze with user inputted size for 2D array. Solves the maze using Breadth-First Search (BFS) and Depth-First Search (DFS).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%