

(The manual for the Commodore 64 presents a BASIC program using this algorithm, but using PETSCII diagonal line graphic characters instead for a smoother graphic appearance.)ĭoes anyone have this Illustrious code handy? I'm more curious than anything else (about how short the code is, not how pretty the resulting maze is). This doesn't generate a valid simply connected maze, but rather a selection of closed loops and unicursal passages. The first confusing part of the article is, that the description of the randomized Prims algorithm does not elaborate on the assumed data structure used by the algorithm. Always pick the same direction for cells on the boundary, and the end result will be a valid simply connected maze that looks like a binary tree, with the upper left corner its root.Ī related form of flipping a coin for each cell is to create an image using a random mix of forward slash and backslash characters. Implementing a randomly generated maze using Prims Algorithm Solution: The description in the Wikipedia article truly deserves improvement. To create a binary tree maze, for each cell flip a coin to decide whether to add a passage leading up or left. A binary tree maze is a standard orthogonal maze where each cell always has a passage leading up or leading left, but never both. Valid simply connected mazes can however be generated by focusing on each cell independently. Most maze generation algorithms require maintaining relationships between cells within it, to ensure the end result will be solvable.
RANDOM MAZE GENERATOR ALGORITHM FULL
However its come full circle again and I just happened to stumble upon this statement in Wikipedia (like that would never lie to me.) I was told years ago that the Commodore 64 Basic programmers manual had very short code to draw a 2D Maze.
