Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nextupvamp/mazes
Application for generating and solving mazes
https://github.com/nextupvamp/mazes
cli java maze-algorithms maze-generation maze-solver
Last synced: 12 days ago
JSON representation
Application for generating and solving mazes
- Host: GitHub
- URL: https://github.com/nextupvamp/mazes
- Owner: nextupvamp
- Created: 2024-10-07T08:08:05.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-10T08:36:31.000Z (about 1 month ago)
- Last Synced: 2024-11-10T09:27:26.813Z (about 1 month ago)
- Topics: cli, java, maze-algorithms, maze-generation, maze-solver
- Language: Java
- Homepage:
- Size: 161 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
* Three maze generation algorithms have been implemented: Prim's algorithm, Wilson's algorithm, and the braid maze algorithm.
* Two pathfinding algorithms have been implemented: iterative DFS and A-star.
* Various types of surfaces (modifiers) have been implemented.Examples of operation:
Prim's algorithm, DFS.
![img.png](examples/img.png)
Wilson's algorithm, A-Star. The maze is braided. Modifiers have been added.
Original maze:
![img_1.png](examples/img_1.png)
Traversed maze:
![img_2.png](examples/img_2.png)
The entire process:
![img_3.png](examples/img_3.png)
![img_4.png](examples/img_4.png)
![img_5.png](examples/img_5.png)Usage
To generate a maze image and find a path within it, please follow these steps:
1. Enter the maze parameters: height and width. The minimum maze size is 1x1, and the maximum is 50x50.
2. Enter the entry point and exit point. The user will be offered two methods for entering these points: by quadrants and by coordinates.
Entering by quadrants implies placing the entry/exit in the corners of the selected quadrant. Entering by coordinates is only possible at the boundary cells of the maze. It is not prohibited to enter the entry and exit in the same cell.
3. Choose whether the maze will be woven. A woven maze is a maze without dead ends. Its feature is that, unlike a non-woven or "perfect" maze, multiple paths can be established between any two points.
4. Based on the user’s choice, options will be given to add modifiers to the maze. Modifiers increase or decrease the traversal cost of a cell. There are two types of modifiers: jungles and diamonds. Jungles increase the traversal cost by 2, while diamonds decrease it by 3.
5. If the user agrees to add modifiers, they will be prompted to enter the probability of modifiers appearing on each cell. The total probability of a modifier's appearance is entered. The probability of whether it will be a diamond or a jungle is equal.
6. Choose the maze generation algorithm.
7. Choose the path-finding algorithm from the entry point to the exit.After entering the input data, an image of the generated maze and an image of the maze with the found path will be displayed. The parameters of the found path will also be shown: path length - the cost of traversing the path considering the modifiers, and number of steps - the number of cells traversed in the maze. If the path is not found, a message will be displayed.