Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Maze generation algorithm
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Recursive division method=== {| class="wikitable" style="margin:auto" |+ '''Illustration of Recursive Division''' |- ! width="110px" | ''original chamber'' ! width="110px" | ''division by two walls'' ! width="110px" | ''holes in walls'' ! width="110px" | ''continue subdividing...'' ! width="110px" | ''completed'' |- | align="center" | [[File:Chamber.svg|thumb|step 1|101px]] | align="center" | [[File:Chamber-division.svg|thumb|step 2|101px]] | align="center" | [[File:Chamber-divided.svg|thumb|step 3|101px]] | align="center" | [[File:Chamber-subdivision.svg|thumb|step 4|101px]] | align="center" | [[File:Chamber-finished.svg|thumb|step 5|101px]] |} {{clear}} Mazes can be created with ''recursive division'', an algorithm which works as follows: Begin with the maze's space with no walls. Call this a chamber. Divide the chamber with a randomly positioned wall (or multiple walls) where each wall contains a randomly positioned passage opening within it. Then recursively repeat the process on the subchambers until all chambers are minimum sized. This method results in mazes with long straight walls crossing their space, making it easier to see which areas to avoid. For example, in a rectangular maze, build at random points two walls that are perpendicular to each other. These two walls divide the large chamber into four smaller chambers separated by four walls. Choose three of the four walls at random, and open a one cell-wide hole at a random point in each of the three. Continue in this manner recursively, until every chamber has a width of one cell in either of the two directions.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)