This program generates mazes with either dfs or bfs algorithms. It can also solve them with either a depth-first search or a breadth-first search.
To compile file for first time usage, type the following in the terminal
make
To generates random mazes type this in terminal:
./maze
./maze --animate //Adds animation when generating
./maze --char //Removes graphical colors
The program also allows you to generate mazes and then solve them on your own
To solve you own maze that you have saved as a txt file type the following command in terminal:
./maze < <filename>.txt
Or you can type:
./maze < <filename>.txt > <solutionfile>.txt
To see the solution in a separate .txt file
- The width and height of maze must be of odd numbers.
- All walls are represented by non-whitespaces.
- All paths are represented by ' '.
- There must be a 'S' on the top row representing the start cell.
- There must be a 'E' on the bottom row representing the end cell.
- The start and end cell chars cannot be in a corner.
make #Compiles code
make run #Runs the program
make animate #Runs the program with animation
make char #Runs the program without the GUI
make charAnimate #Runs the program with animation, without GUI
make file #Runs the program to solve a .txt file
make file2 #Runs the program to solve a .txt file and prints result to another one