The maze.c is written by C language using "graphics.h" and run with drawapp-2.0.app to draw the picture. Deep Search First (DFS) algorithm is used to create a random maze and find a path to fix the maze as well. The route may not be the shortest one. The maze solver, robot, would find the route out of maze step by step, so you can watch and see how it solve a maze.
You can change the size of the maze by changing maze_size in line 19 of maze.c file. Reminder: the maze size can only be an odd number or it would generate a maze that may have no route out.
The program is compiled using gcc compiler.
First create a new terminal in the folder where the file is located
Then type:
gcc -o maze maze.c graphics.c
Then run with:
./maze | java -jar drawapp-2.0.jar
Build a struct stack:
Generate maze using DFS:
DFS robot moving algorithm: