Quantcast
Channel: Planet Python
Viewing all articles
Browse latest Browse all 22462

Andre Roberge: Generating mazes

$
0
0
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.

Viewing all articles
Browse latest Browse all 22462

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>