Skip to content

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

 
 
 

Contributors

Languages