Skip to content

A Python-based project that generates random mazes and solves them using classic Data Structures and Algorithms, with interactive visualization.

Notifications You must be signed in to change notification settings

VRJ1718/Maze-Solver-Visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงฉ Maze Solver โ€“ Visual Pathfinding with Pygame

A Python-based interactive Maze Solver that visually demonstrates maze generation and shortest-path solving using classic algorithms. Built with Pygame, this project brings algorithms to life with smooth animations, theme toggles, and responsive design.


โœจ Key Highlights

๐Ÿš€ Algorithm Visualization
๐ŸŽฎ Interactive & Animated UI
๐ŸŒ“ Light / Dark Mode Support
๐Ÿ–ฅ๏ธ Fullscreen & Responsive Scaling
๐Ÿง  Shortest Path Guaranteed


๐Ÿ› ๏ธ Features Overview

๐Ÿ”น Maze Generation

  • Random maze generation using Depth-First Search (DFS) with backtracking
  • Ensures every maze is fully solvable

๐Ÿ”น Maze Solving

  • Uses Breadth-First Search (BFS)
  • Always finds the shortest path from start to end

๐Ÿ”น Interactive Visualization

  • Real-time rendering of:
    • Walls
    • Start & End points
    • Solution path
  • Smooth step-by-step animation of the solver

๐Ÿ”น Customization Options

  • ๐ŸŒ“ Toggle between Light & Dark themes
  • ๐Ÿ–ฅ๏ธ Switch Fullscreen / Windowed mode
  • ๐Ÿ“ Automatically adapts maze size based on screen resolution

๐Ÿ“ฆ Requirements

  • Python 3.7+

  • Pygame

  • Install dependency:
    pip install pygame


โ–ถ๏ธ How to Run

  • Clone the repository

git clone https://github.com/VRJ1718/maze-solver.git
cd maze-solver

  • Run the application

python main.py

  • ๐ŸŽฎ Controls
    Key Action
    F Toggle Fullscreen
    M Toggle Light / Dark Mode
    ESC Exit Program

  • ๐Ÿ“ Project Structure maze-solver/
    โ”‚
    โ”œโ”€โ”€ main.py # Application entry point
    โ”œโ”€โ”€ maze.py # Maze generation logic (DFS)
    โ”œโ”€โ”€ maze_solver.py # Maze solving logic (BFS)
    โ”œโ”€โ”€ visuals.py # Rendering & visualization


๐ŸŽจ Theme Modes

๐ŸŒž Light Mode

Background: White
Walls: Black
Solution Path: Yellow

๐ŸŒ™ Dark Mode

Background: Black
Walls: White
Solution Path: Green


๐Ÿค Contributing

Contributions are welcome! ๐Ÿš€

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature-branch
  3. Commit your changes
    git commit -m "Add new feature"
  4. Push to GitHub
    git push origin feature-branch
  5. Open a Pull Request

๐Ÿ“œ License

This project is licensed under the MIT License.
See the LICENSE file for details.


๐Ÿ™Œ Acknowledgments

Inspired by classic Computer Science pathfinding algorithms

Built using Pygame for smooth visualization and interaction

โญ If you like this project, donโ€™t forget to star the repository!

Happy Coding ๐Ÿ’ปโœจ

About

A Python-based project that generates random mazes and solves them using classic Data Structures and Algorithms, with interactive visualization.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages