Friday, June 19, 2015

Generating mazes

While Reeborg's World was primarily designed for beginners, it can be used to illustrate relatively advanced topics in a fun way.  For example, one can generate mazes using a depth-first algorithm.

Of course, generating mazes is only half the fun: the real fun is to use them to set Reeborg on a treasure hunt:

Fairly large mazes can be generated, but it does take a fair bit of time. I'm using many generic functions written for the world editor to change the world configuration; these are well-tested and designed for fool-proof interactive use, adding or removing one element at a time.  A more efficient way would be to manipulate directly the world object (implemented as a mixture of dict and lists - to use the Python terms, although they are in this case the javascript equivalents).

For those interested, the details can be found here.

1 comment:

Anonymous said...


I teach high school programming in Winder, GA. I've been using RUR-PLE as a way to bridge the transition from block-based coding, like Scratch, to text-based. I wanted to thank you for creating it as my students have enjoyed learning what they call "real programming".

Please contact me if I can help in anyway or if you'd like to video conference in a demonstration of what we do.