Skip to content

Conversation

Yehuda-Bergstein
Copy link

Changes Made

  • Added a new algorithm called the "Aldous-Broder Algorithm" to the file src/algorithm.py
  • Added demo script in examples/aldous_broder.py
  • Added an option to set the start point of the algorithm

Why?

  1. Inspired by Jamis Buck's blog post, I wanted to be able to create a maze that has no 'bias' put simply, by using a form of 'random walk' (The most complex maze for the given space)
  2. Added an option to define the starting cell for an algorithm to begin at, because this algorithm requires that it starts at a random cell (cell must be chosen randomly by user)

Aldous-Broder Algorithm

  1. Choose a random cell, it is marked as visited and becomes the 'current cell'
  2. Of the four neighbors, one is chosen randomly and becomes the 'current cell'
  3. If the neighbor cell is 'unvisited', it is marked as 'visited' and the wall between this cell and the previous cell is removed.
    If it's already 'visited', the wall is not removed between this cell and the previous cell
  4. Repeat steps 2-3 until all cells are marked as 'visited'
  • Currently it was tested and works only with 'show_maze' function, and it doesn't work for example with show_generation_animation

@Yehuda-Bergstein
Copy link
Author

Hey! can you add it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant