Maze generator & solver using backtracking
Written in C++ and SFML
- Maze Generation
- Maze Solving
- Finding all shortest paths
- Resizing
- Adjusting simulation speed & wall thickness
- Changing start and end positions
- Manually editing the maze
- Exporting as an Image
Randomly generate a maze with initially only 1 solution as many times as you want.
Solve the maze, backtracking at the first solution found.
Find all the shortest paths in the maze and view them all with side arrows.
Resize the grid and regenerate the maze.
Pause (speed to 0), slow down or speed up the simulation speed at any time. Increase or decrease the wall thickness.
Change start & end positions for the maze.
In edit mode:
Left mouse click toggles the visibility of the top wall of any cell.
Right mouse click does the same for the right wall
Export the maze as an image in PNG format.
- g++ 4.8 or above
- GNU Make
- SFML 2.5.1 or above [www.sfml-dev.org]
- You can run these commands on linux to install g++, Make and SFML
$ sudo apt-get install g++
$ sudo apt-get install make
$ sudo apt-get install libsfml-dev
- Install the proper SFML version from the website (MinGW version for GNU Make build or Visual C++ for MS Build)
- Unzip the SFML downloaded folder ( You can install 7zip to be able to unzip )
- Install GNU Make by installing chocolatey package manager and running this command from an elevated Command Prompt:
$ choco install make
-
Install MinGW g++ MinGW 32-bit or MinGW 64-bit (The SFML version and the MinGW version have to match)
-
After unzipping the MinGW file, add your path to mingw32/bin or mingw64/bin to PATH in the system environmental variables
-
Edit the
SFML_DIR
in the Makefile to add your correct SFML folder or copy the folder to the project directory and name the folder 'SFML'
- Visual Studio 15 or above
- VC++ 15 or above
-
Download source code
-
Open your terminal in your project directory where the Makefile exists
-
Run Make in your terminal:
$ make
- List of make commands you can use
# Build and run in release mode
$ make
# Build and run in debug mode
$ make debug && make run
# Rebuild in release or debug mode
$ make rebuild
# or
$ make rebuild-debug
# Clean the files
$ make clean
# Run the latest compiled build
$ make run
-
Add the
</path/to/sfml_folder/>/include
to your additional C++ include directories. -
Add
</path/to/sfml_folder/>/lib
to your additional library directories. -
Add the SFML libraries used to your additional dependencies
eg:
sfml-graphics.lib;sfml-system.lib;sfml-window.lib;
-
Add the dlls in your SFML path/bin along with your executable
This project is licensed under the MIT License.