Hello!
I’m trying to make a program that generates a random labyrinth, I do this by using a Randomized Depth-First (se wikipedia, http://en.wikipedia.org/wiki/Maze_generation_algorithm , for the basic idea). I have just one problem, I want to be going in randomized directions but I don’t want the program to check the same direction twice. So I want it to pick a random direction and if that “cell” has already been visited (meaning there can’t be a path going from the current cell to that cell) then I want the program to check another direction from the current cell without ever checking the same direction again (since we know it’s unavailable).
One suggestion I was considering is to create a collection and mixing it with Collection.shuffle but I’ve never used collections before and I don’t know how to use that to make the program call 4 methods in a random order that way.
Anyone have a recommendation or a good trick I can use?
Thank you!