October 10, 2006

Printable Mazes

Here is a free PDF maze generator that can create mazes of various sizes and complexity, including pretty diabolical mazes that include 3-d crossings...

Maze Options

This form drives some of the options on the maze generator:

width in points
height in points
cell size
pages
curvy straight
crossings not

Programming in PostScript

When I was a student at Cornell I was a postscript fanatic. PostScript is a complete programming language that happens to be used by many printers, and I found it amusing to write postscript files that rendered differently every time you printed them. One of my favorite creations was a small postscript file that would generate a random labyrinth each time it was printed; it won the Obfuscated PostScript Contest in 1993. Unfortunately, postscript printers are not that common today - instead, everybody uses PDF to prepare files for printing. Although PDF is related to postscript, PDF is not a complete programming language, so for a while I have wanted to write a maze generator for the web that would just generate PDF mazes using a cgi script in some other language.

The Source

The result is here: a little cgi/commandline program written in about 150 lines of python which takes advantage of the ReportLab pdf generation library to produce its output.

If you improve the program, please let me know. Enjoy!

Posted by David at October 10, 2006 11:11 AM
Comments

Very cool. My 5-year old is on a maze kick. He'll love these. Thanks!

Posted by: Robert W. Anderson at October 12, 2006 11:24 AM

Roger mentioned over email, "If I make a maze 60x60 I get smoke :(".

Basically that's because the maze code puts a 36-point margin around the edge of the paper by default, and throws an exception when a maze ends up being all-margin. Since I figure this blog is read by fellow nerds (like Roger), I didn't bother formatting error messages in my 150-line CGI script: you get to see the stack trace raw.

So how to make really small mazes? You can add "&m=0" to the request URL to make the margin zero points if you like.

Posted by: David at October 17, 2006 01:57 PM

this is totally awesome

you should find a way to make a maze with the center as your goal

Posted by: jesse at January 16, 2007 05:55 AM

Cool - you should include a little attribution URL in your output so I can find it again after printing out a bunch of mazes for the kids (and give yourself a little credit).

Posted by: Patrick Surry at April 23, 2007 01:31 PM

The "make my maze" bwtton generates an error now. Used to work for me.

Posted by: Tom at October 17, 2007 12:56 AM

Fixed!

Posted by: David at October 30, 2007 05:05 AM

Thanks for your program,too easy! I was anticipating HOURS of sitting in front of this computer!

Posted by: Ning at March 10, 2008 07:56 PM

I am curious about your mazes.
I was searching to learn how to make a maze generator myself. I ran across your site.
I have Bible students that I am sure, would love to do these! Maybe I could add a beginning picture and end picture, if allowed.
Another time I will come back and read more. It's late. I would like to put a couple or so of these on my family site, but need to check out your copyright rules, before doing any of these things. Thank you, Carolyn

Posted by: Carolyn at September 12, 2008 01:46 AM

Thanks, David, for this wonderful maze maker. I enjoy easy-to-use process programs. I am making mazes for church kids.

Posted by: Gayle at October 28, 2008 06:13 PM

Ahh I love mazes and so does my son, thanks for this!

Tip: Read this page http://www.inkguides.com/postscript-programming.asp if you are interested in creating your own postscript programs.

Posted by: Stuart at January 2, 2009 08:26 AM

My 5 yr old son loves these mazes, and I often print out a few on my lunch hour for him. Now everyday as I say goodbye going to work, he says "Don't forget the mazes", and rattles off the types & sizes he wants that day. Thanks much!

Posted by: Ken at April 20, 2009 03:46 PM

The make my maze button does not work now. Internal server error.

Posted by: Jenny at October 29, 2009 12:11 AM

Sorry about that - it was broken by a pair.com upgrade.

It's fixed now!

Feel free to email me at the address on the home page if there's a problem.

Posted by: David at October 30, 2009 08:07 PM
Post a comment









Remember personal info?