Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 15 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview

Buy Now



Maze Generation

How to Get Lost in Your Work

Issue: 3.6 (July/August 2005)
Author: Joe Strout
Author Bio: Joe always loved mazes as a child, and spent many long hours generating them by hand, the dolt.
Article Description: No description available.
Article Length (in bytes): 9,897
Starting Page Number: 18
RBD Number: 3610
Resource File(s):

Download Icon 3610.sit Updated: Monday, July 25, 2005 at 11:26 AM

Related Link(s): None
Known Limitations: None

Excerpt of article text...

Mazes are one of those simple puzzles that have been enjoyed throughout history. For most of that history, designing a maze required a lot of careful work. Nowadays, we can let our computers do the grunt work for us. In this article, we'll see how to write REALbasic code that automatically generates a maze of any size and shape we like.

Let's start by considering some of the properties of a good maze. It should certainly be solvable; that is, there must be a path from the start location to the goal location. More generally, it should probably be possible to get from any point in the maze to any other. However, it shouldn't be too easy; there should be only one or a few ways to get from point A to point B.

For a maze composed of square cells, each cell has four walls (ignoring for now the edge cells around the outside of the maze). However, each wall is shared between two cells -- assuming we don't want to support one-way doors -- so really, there are two walls per cell. In the code for this article, I'll assume that a cell "owns" the walls above and to the left of that cell.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.




Weblog Commenting and Trackback by HaloScan.com