CaptainLuma / New-Maze-Generating-Algorithm

Check out this algorithm for maze generation I came up with.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New Maze Generating Algorithm

Check out this maze generating algorithm I came up with.

Visit this site to try it out, or download the files and run "index.html"

The algorithm goes as follows:

  1. Start with a grid of nodes. Each has a direction property that can point nowhere, or to one of its neighbors.
  2. Initialize the grid to be any perfect maze, that being a maze with no loops or isolated areas. Each node should point to one neighboring node, with a single node, the origin node, pointing nowhere.
  3. Repeat the following steps for as many iterations as you'd like:
    • Have the origin node, point to a random neighboring node.
    • That neigboring node becomes the new origin node.
    • have the new origin node point nowhere.

License

MIT

About

Check out this algorithm for maze generation I came up with.

License:MIT License


Languages

Language:JavaScript 85.0%Language:CSS 7.9%Language:HTML 7.0%