Exercise: Sparse Mazes

Learn to draw sparse mazes.

A sneak peek into sparse mazes

The mazes we've generated to this point have been dense mazes, filling the available grid. Not all mazes need to do so, however. For example, if we wanted to represent a cave system with a random maze, we probably wouldn't want the passages packed in as tightly as possible.

For this exercise, we want a sparse maze. We do this by cutting dead ends back, trimming them down, and leaving gaps in our maze like this:

Get hands-on with 1400+ tech skills courses.