Table of Contents
The goal of this project is to implement a program program that can generate and render perfect mazes.
- The program is developed in the
C++
standard language using thegcc
compiler. Additional libraries andQt
modules are used; - The program code is located in the
src
folder; - The program and test build is configured using
CMake
, which is launched usingMakefile
with a standard set of targets for a GNU program:all
,install
,uninstall
,clean
,dvi
,dist
,tests
,gcov_report
. Installation is carried out in thebin
folder in the repository root; - The program is developed in accordance with the principles of object-oriented programming.
The following development patterns are used:
Facade
,MVC
; - The code is written in accordance with
Google Style
; - Modules related to loading and saving a maze to a file, generating an ideal maze, and solving
a maze are covered with
unit
tests;; - The program allows you to:
- The maze can be stored in a file as a number of rows and columns, as well as two matrices
containing the positions of vertical and horizontal walls respectively. The first matrix shows
the wall to the right of each cell, and the second — the wall at the bottom.
An example of such a file:
4 4 0 0 0 1 1 0 1 1 0 1 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 1 0 1 1 1 1 1
- The perfect maze is generated according to Eller's algorithm
- Maximum size of the maze is 50x50
- The solution of the Perfect Maze is generated according to the DFS (deep first search) algorithm
- The maze can be stored in a file as a number of rows and columns, as well as two matrices
containing the positions of vertical and horizontal walls respectively. The first matrix shows
the wall to the right of each cell, and the second — the wall at the bottom.
- The program has a graphical user interface based on the GUI libraries
Qt
withAPI
forC++
. - The graphical user interface contains:
- A button to load a maze from a file;
- A button to generate a perfect maze;
- A button to solve the perfect maze;
- A button to save the maze to a file;
- Spinbox for specifying the number of rows;
- Spinbox for specifying the number of cols;
- Spinboxes for specifying start and end coordinates;
- Implementation class inside the
s21
namespace;
To get a local copy and run it, follow these steps.
-
CMake
sudo apt install cmake
-
Qt
sudo apt install qt6-base-dev
- Install the required software (if missing)
- Clone the repository
git clone [email protected]:emmonbear/A1_Maze_CPP.git
- Run the installation program
make install
- Run the program manually (
A1_Maze_CPP/bin/maze
) or enter the commandmake run
Distributed under the MIT License. See LICENSE.txt
for more information.