Inspired by Mazes for Programmers by Jamis Buck. That has example code in Ruby, for ASCII and PNG output.
https://pragprog.com/book/jbmaze/mazes-for-programmers
Games
- ldmazer
- Not my code at all, written by luser.droog and posted to comp.lang.c
- Draws a naive Lew Pitcher maze and lets the user move around
- Not much fun, but a good skeleton of a maze game
- Uses SDL2 and SDL2_Image libraries for GUI output
- etbmazer
- This is ldmazer made into a simple game
- Now draws a full grid Aldous-Broder maze
- The user is timed for reaching the far corner
- Uses SDL2 and SDL2_Image libraries for GUI output
Demos
- binary_tree
- proof of concept maze, rather boring
- ascii only output
- sidewinder
- better maze, but still has highly visible artifact
- ascii only output
- aldousbroder
- relatively slow random walk algorithm with nice looking mazes
- ascii only output
- prints a blank and a solved version
- testgrid
- code to test grid.c functions
- ascii only output
- testdistance
- code to test distance.c functions
- ascii only output
- TODO: needs better test cases for longest path solving
grid.c
andgrid.h
- implements a grid with a notion of walls between cells
- provides an ASCII art grid printer
- TODO: building walls (deleting connections)
distance.c
anddistance.h
- as an adjuct to
grid.c
, this measures distances - finds one shortest path (just one, even if multiple are possible)
- finds one longest path (just one, even if multiple are possible)
- not constrained to particular maze topologies
- as an adjuct to
Short variables by convention:
g
is gridc
is a celli
is a row numberj
is a column numbert
is a gtype/ctyped
is a direction or a distancego
is a directiondm
is a distance maprc
is a return code
This implementation by Benjamin Elijah Griffin / Eli the Bearded. Begun 11 June 2019.