O'Reilly logo

Mazes for Programmers by Jamis Buck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introducing Weaves and Insets

A weave maze is a maze in which passages weave over and under one another, like noodles in a bowl of spaghetti.

images/weave.png
Figure 5. A Weave Maze

We can’t really draw these with our existing to_png method, because our existing method does not draw any space between adjacent corridors. Without that space, there is too much ambiguity—we can’t tell if a passage has dead-ended, or gone underneath another passage. The following figure shows the same maze as the previous figure, but without any gaps between corridors.

images/weave-no-gap.png

Messy! And even ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required