Cylinder Mazes

Cylinder mazes are a good place to start, because they’re actually really, really easy. You can make a naive one simply by generating a rectangular maze, printing it out, and wrapping it around a soup can so that the ends touch, like this:

images/maze-wrap.png

The problem with this approach is that you wind up with a seam where the maze’s east and west boundaries meet:

images/maze-wrap-seam.png

Is this ringing any bells? You may recall that we ran into a similar issue at the end of our discussion on circle mazes. We can solve the problem here using the same trick we used there: ...

Get Mazes for Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.