Skip to Main Content
Mazes for Programmers
book

Mazes for Programmers

by Jamis Buck
July 2015
Intermediate to advanced content levelIntermediate to advanced
286 pages
6h 31m
English
Pragmatic Bookshelf
Content preview from Mazes for Programmers

Introducing Masking

The idea behind masking is really pretty simple. The basic metaphor is that our grid is essentially a very low-resolution image, where each cell is like a single pixel. Turning any of these pixels off marks them as off-limits, so our maze algorithm (whichever one we’re using) will never try to walk there.

In the following figure, the cell in the southeast corner has been turned off. The resulting maze, then, omits that cell entirely.

images/maze-from-modified-grid.png

Conceptually, that’s really all there is to it! In practice, though, there are some things to consider, and some consequences that follow from mucking with the geometry of our grids like this.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Exercises for Programmers

Exercises for Programmers

Brian P. Hogan

Publisher Resources

ISBN: 9781680501315Errata Page