This project implements the programming project MAGOS, which means Maze GeneratOr and Solver and is composed of some subprojects: Canvas, Maze, Render, Builder, Solver.
The project is a perfect maze generator and solver.
A perfect maze is a maze where each location (cell) is reachable from any other one, and where there is one, and only one, path connecting each pair of locations.
Marcos Antonio Cavalcanti Junior
The folder and files structure is the following:
-
includefolder contains the headers of classes -
helpersfolder contains other resources useful to implementation -
srcfolder contains the implementation of the classes -
testfolder contains codes to test classes and other codes -
buildfolder will contain compilation files generated with help of CMake -
runfolder will contain the executables generated -
datafolder will contain data used by the project, like images, configurations, inputs, ouputs, etcbuilderfolder will contain imagens generated by the builder applicationsolverfolder will contain imagens generated by the solver application
You can go to root directory of the project and:
$ mkdir build
$ cd build/
$ cmake ..
$ make
Or, if you would like to do all from root:
$ mkdir build
$ cmake -H. -Bbuild
$ make -C build/ --no-print-directory
All executables will be placed in run/ folder. So, you can run typing:
$ ./run/[EXECUTABLE]
These are the main executables:
builderbuilds a new maze using Hash Table strategysolversolves a maze (currently, using the Backtracking strategy)magosperforms the game it self building and solving a maze
More details about each executables can be found at CMakeLists.txt file.
A configuration file is set in the root directory, doxygen.cfg.
If you want to generate yours, you can type:
$ doxygen -g [NAME]
Its recommended to custom the following tags: PROJECT_NAME, OUTPUT_DIRECTORY and EXTRACT_PRIVATE.
To generate the files containing the documentation, type:
$ doxygen doxygen.cfg
You can use ffmpeg to make video files of building and solving processes. For example:
ffmpeg -framerate 10 -i building_%06d.png -c:v libx264 -r 30 -pix_fmt yuv420p -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" builder.mp4
ffmpeg -framerate 10 -i solving_%06d.png -c:v libx264 -r 30 -pix_fmt yuv420p -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" solver.mp4
-
On class
Maze- introduce
valid_coord()into_index()andget_cell(), and implement exceptions - implement methods to get states of cells and walls
- refactor order of bits: four first to be walls states
- turn Cell type back to private
- refactor method to reset states in
set_state() - refactor number of bits used, from 8 to 6
- introduce
-
On class
Render- refactor
draw_cell()to use methods provided by Maze - document with details
- draw cell and path of solution
- refactor
-
On class
MagosGame- prevent executable to run without parameters
-
Implement
BuilderandSolverclasses (each class name will refer to the method used)- class
HashBuilder - class
Solver
- class
-
On class
HashBuilder- introduce render object
- save snapshots of maze
- remove internal render and receive it by parameter
- create
step()method - rename class
rouletteand port it to insideHashBuilder - implement Hash Table as a
std::vector(internal class) - number format in file names
-
On class
HashTable- implement exceptions (
key2index(),merge_by_key()) - document with details
- separate
build_maze()tobuild_maze()+build_step()(use classRoulette?) - delete statement on destructor
- implement exceptions (
-
On class
Solver- comment with details
- number format in file names
-
General/Missing
- improve comments
- implement
deletestatements - update
draw_cell() - number format in file names
- comment Magos Game class