September 11, 2008Python Maze GeneratorChris Stakor of Mucho Mazes wants, of course, mucho mazes, and asked for help making our PDF maze generator output multiple mazes at once. Sure thing! The updated python maze generator code now accepts a page count argument. Here is the form: Warning that if you try more than about a dozen pages on my website, my CPU limits will stop the script from completing. Of course, you can run the script on your own server if you want hundreds of pages. It occurs to me that I never bothered to write something to draw solutions. Any volunteers? Posted by David at September 11, 2008 09:07 AMComments
Hi Dave, These mazes are really cool! Thanks for sharing the simple python code. I am working on a solution generator. It currently solves the maze and adds a page of solution per maze, redrawing the maze but with the solution. It is a recursive solution that has problems with very dense mazes (I got it to work down to cell size of 9 on my PowerMac). Also, the drawing of solution path leaves a lot to be desired, especially when cross and/or curve are turned on. I plan to work on those issues next. I will post it on my web site for now. Cheers, Hi, If anyone is interested I got solve to work for all the supported modes... please contact me if you want to share. There is a "mini-blog" of sorts on my web site with a few details and examples. - Tom Posted by: Tom Krauss at October 11, 2008 11:19 PMNote, With David's permission I've made the modified code available at http://www.kraussfamily.org/pymaze_with_soln.py. Hi again! I've attempted a few clean ups to the "drawsolution" function, making it clearer and more compact. Actually, it may be a little too compact to easily follow :-) but it is my attempt at following the style of the original pymaze.py - and it's at the very least better than what I first posted. See my web page for the latest. Best, Post a comment
|
| Copyright 2008 © David Bau. All Rights Reserved. |