Maze generation

Alan McNeely mcneely at ncrcae.Columbia.NCR.COM
Fri Dec 21 07:18:12 AEST 1990


>In article <21945 at ttidca.TTI.COM> alter at ttidca.TTI.COM (Steve Alter) writes:
>>The right-hand-on-the-wall algorithm, in its simple form, won't be able
>>connected) but a simple modification to the algorithm can fix that.
>>Just remember every room you've visited, and as you're walking around,
>>if you see that you're about to step into an already visited room, then
>>just pretend that there's a wall in front of you and continue to apply
>>the right-hand rule.  After that, you can forget about that piece of
>>phantom wall, because the rooms on both sides of it have been visited.
>>

Actually I think you have to remember the wall.  Example:
             -----
            !     !
            !  !  !
      ______!  !  !
FINISH            !
      ------    --
            !  !
            !  !
           START

>From Start,  algorithm goes right,  creates imaginary wall coming back
down toward the 4-way,  and goes back around the inside of the loop.
If we don't remember the imaginary wall we'll be trapped on the loop
indefinitely.  Right?

Alan McNeely
mcneely at bigb.columbia.ncr.com



More information about the Alt.sources.d mailing list