his book shows how to build a random labyrinth. This labyrinth is very simple and consists
of walls and corridors only. But building the labyrinth base (walls and corridors) is the
most important job. After that it is easy to add more stuff like door, secrets, treasures,
his labyrinth generating algorithm is first filling the entire zone with walls and then
building corridors out of them. Each corridor has a random length and a random direction.
While building one corridor the algorithm is randomly spawning branches for new corridors.
The algorith will terminate if it has spawned no more branches. This can happen due to
too many bad die rolls or if there is no more space left on the zone to build any further
'Author : Daniel, Master Sourcerer at Kitana's Cas...
'Last change: May 25, 1999
'Email : firstname.lastname@example.org
'Stack for branches
'Initialize random number generator
G%=&H0720 'corridor (black space character)
M%=&H07DB 'wall (light grey inversed space character)
Z%=&H0458 'exit (red X character)
'Size of labyrinth (must be no larger than dimensions ...
'Initialize labyrinth with walls
FOR J%=0 TO YGR%-1
FOR I%=0 TO XGR%-1
'Start building labyrinth from its middle