The Maze Generator project visualizes the Breadth-First Search (BFS) algorithm used to solve mazes. The project allows users to generate a maze of customizable dimensions and visualize the BFS algorithm's traversal as it finds a path from the top-left corner to the bottom-right corner.
- Generate Maze: Create a new maze of configurable dimensions (rows and columns).
- Solve Maze: Use the BFS algorithm to find a path through the maze and visualize the traversal.
- Dynamic Visualization: Observe the BFS algorithm in action with real-time updates on the maze's traversal.
- HTML for structure
- CSS for styling
- JavaScript for functionality and maze generation
To run the Maze Generator locally, follow these steps:
-
Clone the Repository:
git clone https://github.com/your-username/maze-generator.git
-
Navigate to the Project Directory:
cd maze-generator
-
Open the Project in a Browser:
Open the
index.html
file in your preferred web browser.
-
Set Maze Dimensions:
- Adjust the row and column size using the provided input fields.
-
Generate the Maze:
- Click the "Generate Maze" button to create a maze with the specified dimensions.
-
Solve the Maze:
- Click the "Solve Maze" button to visualize the BFS algorithm finding a path through the maze. The path will be displayed in green, and the BFS traversal will be shown in red.
index.html
: Contains the HTML structure for the maze generator.styles.css
: Includes the CSS styles for maze visualization and layout.script2.js
: Implements the maze generation and BFS algorithm functionality.