4.  First Step

Back Home Up Next

So, what exactly do we do??

The first step

We start out by dropping into any grid location, at random if we want to.  You might also always start at any arbitrary place, as well.  It doesn't really matter.  Either way, the resulting maze will look fine.

Now, we simply break down any one of the walls, except that we don't break down walls that lead to rooms we've already been to.  When we start out, this means almost any wall can be broken.  (Keep in mind that we aren't allowed to break down the walls on the perimeter, though.  The exterior walls must be kept intact.)

In a computer, the process of breaking down a wall might simply be a matter of changing a value of 0 to a value of 1, or the opposite of that.  I tend to use a binary bit for each wall, to conserve memory.  But that isn't at all necessary.   The only requirement is that you invent a consistent way of representing the walls (or the lack of them.)

Once we break down one of the walls, we simply walk into the newly opened room.  Of course, this means keeping track of which room or cell we are currently considering.  Once again, you can use whatever method you like to do this.   But you will need something, a marker that means "I'm here" and you will need to move that marker around as you make the maze.

Once the wall has been taken down and the marker has been moved into the adjacent room, you can then choose any one of the remaining walls to break down.   A modification to the rules already mentioned is important, though.  Do not break down an existing wall if it leads to a room we've already been in (this will cover the case where a wall is already broken down because if it has been broken down, that adjacent room must have already been visited at some point.)

Here's an example of how the original maze may have started:

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |x--> |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

I've placed a little x in the room we might start our marker in and then displayed a small arrow showing the wall that was broken down.  (There's no reason why I picked that particular wall, except that I know from the original maze that that wall was indeed broken down.)

 

Last updated: Tuesday, July 06, 2004 19:06