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

Your Turn

It’s been said that if you stick to the rules, you miss all the fun. When it comes to mazes, at least, there appears to be some truth to that. Knowing which rules to bend (or even break!) can open entire floodgates of possibility.

We focused in this chapter on breaking the rules that forbid self-intersection—that is, allowing passages to intersect themselves. We worked through braiding mazes by removing dead ends, and then further complicated things by dropping pits of molten lava in the middle of our lovely shortest path. We looked at how Dijkstra’s algorithm can compensate for these traps and obstacles—these weights—and give you the most efficient (least expensive) path around them. We implemented weave mazes and a way to draw them ...

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