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
- ๐ Project Overview
- โจ Features
- ๐ป Technologies Used
- โ๏ธ Setup Instructions
- ๐ฅ๏ธ How to Run on Different Operating Systems
- ๐ง Code Explanation
- ๐ฎ Usage
- ๐ Future Improvements
- ๐ค Contributors
- ๐ License
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.
- ๐ 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.
- Programming Language: C++
- Graphics Library: SDL2
- IDE: Visual Studio Code or any C++ IDE of your choice
- Build Tools: CMake, Makefiles
Ensure you have:
- A C++ compiler (e.g., GCC, Clang, or MSVC)
- SDL2 development libraries
- SDL2_image library for image support
- Install SDL2 and SDL2_image:
sudo apt-get install libsdl2-dev libsdl2-image-dev
- Clone the Repository:
git clone https://github.com/NexusGKSoftwares/MAZE-PROJECT.git cd MAZE-PROJECT
- Build the Project:
mkdir build && cd build cmake .. make
- Run the Application:
./maze_solver
- Install SDL2:
- Download SDL2 from the SDL website.
- Extract the files to
C:\SDL2
(or a path of your choice).
- Install a C++ Compiler:
- MinGW: Download from MinGW and add it to your PATH.
- Visual Studio: Set up Visual Studio for C++ development.
- 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.
- For MinGW: Copy
- Run the Program:
- MinGW: Run
maze.exe
in your terminal. - Visual Studio: Press F5 to build and run.
- MinGW: Run
- Install SDL2 and SDL2_image Using Homebrew:
brew install sdl2 sdl2_image
- Clone the Repository:
git clone https://github.com/NexusGKSoftwares/MAZE-PROJECT.git cd MAZE-PROJECT
- Build and Run:
mkdir build && cd build cmake .. make ./maze_solver
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.
- 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.
- Launch the Program: The maze will be generated and displayed.
- Watch the Solution: The A* algorithm will illuminate the path, guiding the image-based navigator through the maze.
- Explore and Customize: Modify
WINDOW_SIZE
orCELL_SIZE
in the code for a different experience.
- ๐ฒ 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.
- NexusGK - Lead Developer and Designer
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! ๐