This project implements the generation of a maze and the search for the shortest path between two given points on the constructed maze. Additionally, there is a function of building caves.
- The generation of caves is carried out by the Eller method (http://www.neocomputer.org/projects/eller.html ).
- The generation of caves is carried out on the basis of a cellular automaton (https://en.wikipedia.org/wiki/Cellular_automaton ).
To build , you need:
CMAKE 3.5
or higherQT 5.15.2
or higher
To build from the root of the project:
cmake -S ./src/ -B ./build/ && cmake --build ./build --target Maze
The path to the archive with data from the project root:
./datasets/data.tar.gz
As already mentioned, the construction of mazes is carried out using the Eller algorithm, finding the path by searching in depth.
- Generation is carried out by pressing the
GENERATE
button with the specified parameters of the number of rows and columns of the maze. - The number of rows and columns of the maze are adjusted using the SpinBox (1-50).
- To find the path, you need to use the
LMB
to click on the first point and repeat the steps for the second point. The shortest path from point 1 to point 2 will be constructed. - To clear the built path - click
PCM
on the rendering scene. - To load the maze from a txt file - the
LOAD
button. - To save the maze to a txt file - the
SAVE
button.
The construction of caves takes place on the basis of a cellular automaton, but with a slight difference in that it is possible
to adjust the parameters for birth and death. Automatic operation mode is also provided for convenient visualization.
To switch to cave mode - you need to press the CAVE MODE
button
- Generation is carried out by pressing the
GENERATE
button with the specified parameters of the number of rows, columns, the limit of birth, the limit of death and the chance of the initial appearance of the cell. - In order to move to the next state of the caves - the `NEXT STEP' button.
- The number of rows and columns of the cave are adjusted using the SpinBox (1-50).
- The limits of birth and death of cells are adjusted using the SpinBox (0-7).
- The chance of the initial appearance of the cells are adjusted using the SpinBox (1-100).
- You can switch to automatic generation mode, there is an
AUTO
button for this. - For automatic operation mode, you can set the step frequency in milliseconds (300-2000).
- To load a cave from a txt file, use the
LOAD
button. - To save the cave to a txt file - the
SAVE
button.
Authors:
- A. Savin aka telvina [email protected]
- A. Degtyarev aka sreanna