LeeSinLiang / Custom-Maze-Generation-Animation

Custom Maze Generation with DFS and Finding Shortest Path

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom Maze Generation (with Animation!)

Figure 1: Maze Generation with DFS Shortest Path Finder (Speed up 2x)

license Code language count GitHub top language

Maze Generation

  1. DFS Traversal.
  2. Random shuffle 4 directions (Up, Down, Left, Right) while traversing to destination.
  3. Repeat step 1-2 with random start coords in main path and random end coords. This will be our available paths to traverse.
  4. Once we finished setting our available path, start constructing maze's wall by traversing while making sure wall does not collide with path. Again, the coords are shuffled.
  5. Run DFS to find the shortest path to traverse after the maze construction.
  6. VoilĂ !

Resources

Original Demo (Non speed up)

maze_original.mp4

About

Custom Maze Generation with DFS and Finding Shortest Path

License:Apache License 2.0


Languages

Language:JavaScript 91.6%Language:HTML 8.4%