[MUD-Dev] Re: AFAP: As fast as possible, non linear...

Alex Oren alexo at bigfoot.com
Tue Dec 15 10:01:33 CET 1998


On Mon, 14 Dec 1998 21:38:42 +0000, Mik Clarke wrote:

} Hmmm. A few years ago (quite a few) I had a maze generator running on a
} lowly 0.7Mhz Dragon micro-computer, written in basic.

Deja-vu...

Done the same algorithm on a TRS CoCo (very similar to the Dragon, 0.895MHz
overclocked to x2).

} The baic algorythm was to generate
} the maze by moving from the end of the path to a randomly picked
} adjacent cell that the maze didn't already reach.  When it got stuck (a
} square where all adjacent squares were already on the path) it would
} backup to find a cell that it could branch from.

Use a multidimensional array representing the cells.  For each cell, keep a
"visited" flag and the direction you reached it from (for backtracking).
Initially, there are no connections between the cells.  When you move from a
cell to an adjacent one a connection is made.

Have fun,
Alex.




More information about the mud-dev-archive mailing list