1.  Structure

Home Up Next

I guess the first thing to do is to look at an actual maze!

An example maze structure

If you'll excuse the text-only sample, let's start out by taking a look at one.  (You may have to use your imagination just a bit, but the following is one way of drawing a maze with simple, ASCII characters on a text-only printing device.   It's not bad once you get used to it.  It also has some advantages, such as faster download time for the web page and that it even looks fine with Lynx browsers.)

+  +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|  |     |           |           |                 |        |
+  +  +  +  +--+--+  +  +  +--+  +  +  +--+--+--+  +  +--+  +
|     |  |  |     |     |  |     |  |     |        |     |  |
+--+  +  +--+  +  +--+--+  +  +--+--+--+  +  +--+--+--+--+  +
|     |        |           |  |           |     |  |        |
+  +  +--+--+--+--+--+--+--+  +--+--+--+--+--+  +  +  +--+--+
|  |           |           |        |              |  |     |
+  +--+--+--+  +--+--+--+  +--+--+  +  +--+  +--+  +  +--+  +
|           |           |           |     |  |  |     |     |
+--+--+  +  +--+--+--+  +--+--+--+--+--+  +  +  +--+--+  +--+
|        |  |     |        |  |           |                 |
+  +--+--+  +  +  +  +--+--+  +  +--+--+--+  +--+--+--+--+  +
|     |     |  |     |     |  |     |     |        |        |
+--+--+  +--+  +--+--+--+  +  +--+  +  +  +--+--+  +  +--+  +
|        |     |           |           |  |        |     |  |
+  +--+--+  +--+  +--+--+  +--+--+--+--+  +--+--+--+--+--+  +
|  |     |     |        |     |        |     |     |        |
+  +  +  +--+  +--+--+  +  +--+  +--+  +--+  +  +--+  +--+  +
|     |     |           |        |           |        |     |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+  +

One of the things you may notice is that the maze actually looks like one.  That's a good thing.

But stand back just a bit from it and you may also notice that it has a grid or matrix structure.  And if you count horizontally and vertically, you'll see that this maze has what appears to be 20 columns and 10 rows.

This is a clue about teaching a computer how to make one.   Perhaps it would be a good idea to consider using a matrix to represent the maze.

 

Last updated: Tuesday, July 06, 2004 23:54