Saturday, November 28, 2015

Irregular maze generator (from ASCII tessellation) - Part 1

I wanted to write a generalized ASCII maze generator which could create a unlimited variety of tessellations.  

So I first created a parser that could detect "edges" in an ASCII "image"


Then the script will knock out wall in the ASCII image to create a maze.


This can generate irregularly shaped mazes, based on the ASCII template.  

Source code is at:


Python2: https://github.com/sevkeifert/text-utils/blob/master/maze-ify-ascii.py

Python3: https://github.com/sevkeifert/text-utils/blob/master/maze-ify-ascii-v3.py




USAGE:


   maze-ify-ascii.py -f YOUR_TEMPLATE_FILE  



For example, here's a basic grid:






Grid with holes:



Oblique


Hexagonal tessellation:




Complex Features
Irregular shape, with holes, multiple regions, text, and protected whitespace



Now for Part II: parsing the space *inside* font characters:

No comments: