Skip to content

Maze Generator and Solver Welcome to the Maze Generator and Solver project! ๐Ÿš€ This C++ application, powered by SDL2, creates and solves mazes with captivating visuals. Experience the beauty of algorithms as you watch mazes being generated and solved before your eyes. Ready to dive in? Let's get started!

License

Notifications You must be signed in to change notification settings

NexusGKSoftwares/MAZE-PROJECT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


๐ŸŒ€ Maze Generator and Solver

Welcome to the Maze Generator and Solver project! ๐Ÿš€ This C++ application, powered by SDL2, creates and solves mazes with captivating visuals. Experience the beauty of algorithms as you watch mazes being generated and solved before your eyes. Ready to dive in? Let's get started!

GitHub Repository: MAZE-PROJECT


๐Ÿ“‹ Table of Contents

  1. ๐Ÿ” Project Overview
  2. โœจ Features
  3. ๐Ÿ’ป Technologies Used
  4. โš™๏ธ Setup Instructions
  5. ๐Ÿ–ฅ๏ธ How to Run on Different Operating Systems
  6. ๐Ÿ”ง Code Explanation
  7. ๐ŸŽฎ Usage
  8. ๐Ÿš€ Future Improvements
  9. ๐Ÿค Contributors
  10. ๐Ÿ“œ License

๐Ÿ” Project Overview

This project is a visual demonstration of maze generation using a randomized depth-first search algorithm and maze-solving using the A algorithm*. ๐Ÿงฉ It combines stunning graphics with an intuitive interface, making algorithmic pathfinding both fun and educational.

โœจ Features

  • ๐ŸŒ€ Dynamic Maze Generation: Watch as a maze unfolds in real-time with the depth-first search algorithm.
  • ๐ŸŸข Pathfinding Visualization: See the A* algorithm in action as it solves the maze and reveals the optimal path.
  • ๐Ÿ”ง Customizable Maze Sizes: Adjust the maze dimensions to your liking for varied experiences.
  • ๐Ÿ“ธ Image-Based Navigator: A visually appealing way to follow the solution through the maze.
  • ๐Ÿ’ฌ Interactive Graphics: Experience a seamless and engaging user interface.

๐Ÿ’ป Technologies Used

  • Programming Language: C++
  • Graphics Library: SDL2
  • IDE: Visual Studio Code or any C++ IDE of your choice
  • Build Tools: CMake, Makefiles

โš™๏ธ Setup Instructions

Prerequisites

Ensure you have:

  • A C++ compiler (e.g., GCC, Clang, or MSVC)
  • SDL2 development libraries
  • SDL2_image library for image support

๐Ÿ–ฅ๏ธ How to Run on Different Operating Systems

๐Ÿง Running on Linux (Ubuntu)

  1. Install SDL2 and SDL2_image:
    sudo apt-get install libsdl2-dev libsdl2-image-dev
  2. Clone the Repository:
    git clone https://github.com/NexusGKSoftwares/MAZE-PROJECT.git
    cd MAZE-PROJECT
  3. Build the Project:
    mkdir build && cd build
    cmake ..
    make
  4. Run the Application:
    ./maze_solver

๐ŸชŸ Running on Windows

  1. Install SDL2:
    • Download SDL2 from the SDL website.
    • Extract the files to C:\SDL2 (or a path of your choice).
  2. Install a C++ Compiler:
    • MinGW: Download from MinGW and add it to your PATH.
    • Visual Studio: Set up Visual Studio for C++ development.
  3. Set Up SDL2 in Your IDE:
    • For MinGW: Copy SDL2.dll to your project directory and compile:
      g++ maze.cpp -o maze.exe -I"C:\path\to\SDL2\include" -L"C:\path\to\SDL2\lib" -lmingw32 -lSDL2main -lSDL2
    • For Visual Studio: Configure the include and library directories.
  4. Run the Program:
    • MinGW: Run maze.exe in your terminal.
    • Visual Studio: Press F5 to build and run.

๐Ÿ Running on macOS

  1. Install SDL2 and SDL2_image Using Homebrew:
    brew install sdl2 sdl2_image
  2. Clone the Repository:
    git clone https://github.com/NexusGKSoftwares/MAZE-PROJECT.git
    cd MAZE-PROJECT
  3. Build and Run:
    mkdir build && cd build
    cmake ..
    make
    ./maze_solver

๐Ÿ”ง Code Explanation

The project is divided into components that handle maze generation, solving, and rendering.

  • ๐ŸŒ€ Maze Generation: Uses a depth-first search to create complex paths.
  • ๐ŸŸข Pathfinding: Implements the A* algorithm for efficient navigation.

Key Classes and Algorithms

  • Point Struct: Represents (x, y) coordinates in the maze grid.
  • Maze Class: Manages the maze structure, generation, and solving processes.
  • Depth-First Search: Generates the maze layout.
  • A Algorithm:* Solves the maze efficiently.

๐ŸŽฎ Usage

  1. Launch the Program: The maze will be generated and displayed.
  2. Watch the Solution: The A* algorithm will illuminate the path, guiding the image-based navigator through the maze.
  3. Explore and Customize: Modify WINDOW_SIZE or CELL_SIZE in the code for a different experience.

๐Ÿš€ Future Improvements

  • ๐ŸŽฒ Multiple Maze Algorithms: Add new generation techniques like Primโ€™s or Kruskalโ€™s algorithm.
  • ๐Ÿ› ๏ธ Difficulty Settings: Allow users to choose the maze complexity.
  • ๐Ÿ“ฑ Improved GUI: Introduce a more user-friendly interface.
  • ๐ŸŽฎ User-Controlled Navigation: Let users manually solve the maze.

๐Ÿค Contributors

  • NexusGK - Lead Developer and Designer

๐Ÿ“œ License

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


Feel free to reach out with questions, feedback, or suggestions. Happy maze-solving! ๐ŸŽ‰

About

Maze Generator and Solver Welcome to the Maze Generator and Solver project! ๐Ÿš€ This C++ application, powered by SDL2, creates and solves mazes with captivating visuals. Experience the beauty of algorithms as you watch mazes being generated and solved before your eyes. Ready to dive in? Let's get started!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages