Difference between revisions of "Brain Maze"

From Noah.org
Jump to: navigation, search
(New page: Category:Engineering Category:Free_Software Category:Python This is a fractal algorithm I created for generating mazes. I think it's pretty neat. This generates a random maze...)
 
Line 3: Line 3:
 
[[Category:Python]]
 
[[Category:Python]]
  
This is a fractal algorithm I created for generating mazes. I think it's pretty neat.
+
This is a fractal algorithm I created for generating mazes. I think it's pretty neat. I came up with this in the early 90's for a computer science class -- I think it was Data Structures and Algorithms. The original was written in C. This version is in Python.
  
This generates a random maze with no loops -- a single connected path links all elements of the maze. This maze
+
This generates a random maze with no loops -- a single connected path links all elements of the maze. This maze also has the property that it is space filling.
also has the property that it is space filling.
+
  
 
You can run the brain maze algorithm by clicking here: [http://www.noah.org/cgi-bin/brainmaze.py brainmaze.py]
 
You can run the brain maze algorithm by clicking here: [http://www.noah.org/cgi-bin/brainmaze.py brainmaze.py]
Line 17: Line 16:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 35: Line 33:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 53: Line 50:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 71: Line 67:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 89: Line 84:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 107: Line 101:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 125: Line 118:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 143: Line 135:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 161: Line 152:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 179: Line 169:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 197: Line 186:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 215: Line 203:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 233: Line 220:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 251: Line 237:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 269: Line 254:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 287: Line 271:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 305: Line 288:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 323: Line 305:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
</tr>
 
</tr>
Line 341: Line 322:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 359: Line 339:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 377: Line 356:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 395: Line 373:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
</tr>
 
</tr>
 
 
<tr>
 
<tr>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 413: Line 390:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 431: Line 407:
 
</tr>
 
</tr>
 
<tr>
 
<tr>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 449: Line 424:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 467: Line 441:
 
<tr>
 
<tr>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 485: Line 458:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 503: Line 475:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 521: Line 492:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 539: Line 509:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 557: Line 526:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 575: Line 543:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 593: Line 560:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 611: Line 577:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 629: Line 594:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 647: Line 611:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 665: Line 628:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 683: Line 645:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 701: Line 662:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 719: Line 679:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 737: Line 696:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 755: Line 713:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 773: Line 730:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 791: Line 747:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 809: Line 764:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 827: Line 781:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 845: Line 798:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 863: Line 815:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 881: Line 832:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 899: Line 849:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 917: Line 866:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
</tr>
 
</tr>
Line 935: Line 883:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 953: Line 900:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 971: Line 917:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 989: Line 934:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
</tr>
 
</tr>
 
 
<tr>
 
<tr>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 1,007: Line 951:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 1,025: Line 968:
 
</tr>
 
</tr>
 
<tr>
 
<tr>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 1,043: Line 985:
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
 
<td  width="9" height="9" bgcolor="#000000"></td>
Line 1,061: Line 1,002:
 
<tr>
 
<tr>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
Line 1,079: Line 1,019:
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>
 
<td  width="9" height="9" bgcolor="#ffffff"></td>

Revision as of 07:51, 7 December 2007


This is a fractal algorithm I created for generating mazes. I think it's pretty neat. I came up with this in the early 90's for a computer science class -- I think it was Data Structures and Algorithms. The original was written in C. This version is in Python.

This generates a random maze with no loops -- a single connected path links all elements of the maze. This maze also has the property that it is space filling.

You can run the brain maze algorithm by clicking here: brainmaze.py

<include svncat src="file:///home/svn/src/python/brainmaze.py" highlight="python" />