/MazeGenerator

A Maze Generator to visualize BFS algorithm

Primary LanguageJavaScript

Maze Generator

Overview

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.

Features

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

Technologies

  • HTML for structure
  • CSS for styling
  • JavaScript for functionality and maze generation

Getting Started

To run the Maze Generator locally, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/your-username/maze-generator.git
  2. Navigate to the Project Directory:

    cd maze-generator
  3. Open the Project in a Browser:

    Open the index.html file in your preferred web browser.

Usage

  1. Set Maze Dimensions:

    • Adjust the row and column size using the provided input fields.
  2. Generate the Maze:

    • Click the "Generate Maze" button to create a maze with the specified dimensions.
  3. 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.

File Structure

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