Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/israel-charles/gui-dynamic-maze-solver
Java-based GUI application that solves mazes using backtracking algorithm. It visualizes the maze-solving process in real-time, highlighting the current path, backtracking steps, and teleportation through portals. The application effectively demonstrates pathfinding algorithms by marking visited cells, backtracking paths, and portal usage.
https://github.com/israel-charles/gui-dynamic-maze-solver
backtracking backtracking-algorithm dynamic-programming java java-swing maze maze-solver
Last synced: about 22 hours ago
JSON representation
Java-based GUI application that solves mazes using backtracking algorithm. It visualizes the maze-solving process in real-time, highlighting the current path, backtracking steps, and teleportation through portals. The application effectively demonstrates pathfinding algorithms by marking visited cells, backtracking paths, and portal usage.
- Host: GitHub
- URL: https://github.com/israel-charles/gui-dynamic-maze-solver
- Owner: Israel-Charles
- Created: 2024-08-16T15:14:53.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-10-08T18:23:30.000Z (3 months ago)
- Last Synced: 2024-11-17T09:18:06.114Z (2 months ago)
- Topics: backtracking, backtracking-algorithm, dynamic-programming, java, java-swing, maze, maze-solver
- Language: Java
- Homepage: https://codepad.site/pad/a49untl5
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GUI Dynamic Maze Solver
Dynamic Maze Solver is a Java-based graphical application that demonstrates maze-solving techniques using a backtracking algorithm. This project visualizes the process of solving a maze in real-time, showcasing pathfinding, backtracking, and teleportation mechanics through portals.### Demo > https://codepad.site/pad/a49untl5
## Features
- **Real-time Visualization:** Watch the algorithm solve the maze step by step.
- **Backtracking:** See the algorithm backtrack from dead ends and visualize the path taken.
- **Portals:** Experience teleportation through numbered portals.
- **Start and End Points:** Clearly labeled start (`S`) and exit (`E`) points.
- **Interactive Graphics:** Uses Java Swing to provide a graphical representation of the maze.## How It Works
1. **Maze Representation:** The maze is represented as a 2D grid, read from a text file where each character denotes a wall, path, portal, start, or exit.
2. **Pathfinding Algorithm:** A backtracking algorithm explores the maze, visiting valid paths, utilizing portals, and marking visited and backtracked paths.
3. **Visualization:** The graphical interface updates in real-time to show the current position, visited cells, and backtracked paths.## Prerequisites
- Java Development Kit (JDK) 8 or later.
- An IDE or text editor to view and run the Java program.## Setup
1. **Clone the Repository:**
```bash
git clone https://github.com/Israel-Charles/Dynamic-Maze-Solver.git
```2. **Navigate to the Project Directory:**
```bash
cd DynamicMazeSolver
```3. **Compile the Java Program:**
```bash
javac MagicMaze.java
```4. **Run the Program:**
### Maze File Format
1. Create a text file in the project directory to pass it as argument when running the program.
2. Use characters to design your maze:
- '@' for walls
- '*' for paths
- '0-9' for portal pairs
- 'X' for the exit point#### ***Note: Maze will always start at the bottom left corner***
#### ***Some example maze files are in the repo***
## Run the Program
```bash
java DynamicMazeSolver <# of rows> <# of cols>
```
Example with a maze file that has 15 rows and 20 columns:
```bash
java DynamicMazeSolver maze4.txt 15 20
```