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

Braiding Mazes

images/braid-maze-generated.png

A maze with no dead ends is called a braid maze.

There’s no reason this has to be all-or-nothing, though. Mazes may be heavily braided (with all or most dead ends removed), or lightly braided (with only a few dead ends removed), or anything in-between. The process we’ll consider here, called dead-end culling, will let us produce a maze with any level of braiding we desire.

Recall back in Counting Dead Ends, we added a method to Grid called, appropriately, deadends. We made it return a list of all the dead-end cells in the grid, and used it to compare maze algorithms based on how many dead ends they generated.

It turns out that ...

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