Tag: maze

Another maze generator and solver in C

Another maze generator and solver in C

Solved mazeI liked this one; it compiled perfectly without any changes and ran perfectly. It produces a maze of the specified size with a route. That’s not bad for a program written over 20 years ago. By developer Joe Wingbermuehle. You can view the source code here.

It runs in a terminal, just supply width and height characters like this. I compiled it into a file ex1.

./ex1 15 15 s

If you provide the s parameter, it will solve it as the screenshot shows using <> for the solved route. off for just the maze.

Creating a maze in C

Creating a maze in C

Backtracking mazeThe internet is well not quite awash with maze generators but there certainly are plenty of them about. This one is 100% written in C.

There’s a #define, commented out by default that enables prim’s algorithm. The default is to use depth-first search instead. If you uncomment the #define movie,. it will save out the maze as a series of .bmp files.

I’ve added the link on to the C Code Links page.