You are a maze researcher, working to design a new generation of dungeons and adventuring grounds.
You are a theoretician, which means you are not concerned with the physical layout of mazes (that is a task for maze engineers), but instead you care about their mathematical complexity: branching factor, maximum depth and such.
You decide to approach your next project with a random generation approach.
Any good maze is mostly dead ends.
Define the deadend generator so that it always generates the DeadEnd variant.
Let's give adventurers a reason to venture in your mazes.
Define the treasure generator so that it generates either Gold, Diamond or Friendship with equal probability.
Then, define the room generator so that it wraps the values generated by treasure in the Room variant.
And now for the heart and soul of a maze: branches.
The branch generator receives a Generator Maze argument, which is a generator able to generate an arbitrary maze.
Define the branch generator so that it generates a Branch variant containing several branches leading to mazes generated by its argument.
The number of branches should be between 2 and 4 (any more than that and the maze engineer would get angry), determined randomly with equal probability.
Time to do business.
Define the maze generator so that it generates a dead end 60% of the time, a treasure room 15% of the time and a branch 25% of the time.
The branches should generate new mazes using maze recursively.
Make sure to use deadend, room and branch in the generator.
Each branch contains on average 3 mazes, but only 25% of these will branch out again, which is less than one, so your generated mazes are likely to eventually end.
Your maze is nice, but it has some issues:
MazeMakerSupport.mazeDepth)Define the mazeOfDepth n generator so that it generates a maze of depth n.
Only the deepest level 0 should contain dead ends or treasure rooms (with equal probability), all other levels should be a branch containing mazes of depth n-1 generated recursively with mazeOfDepth.
Make sure to use deadend, room and branch in the generator.
You are a maze researcher, working to design a new generation of dungeons and adventuring grounds.
You are a theoretician, which means you are not concerned with the physical layout of mazes (that is a task for maze engineers), but instead you care about their mathematical complexity: branching factor, maximum depth and such.
You decide to approach your next project with a random generation approach.
Any good maze is mostly dead ends.
Define the deadend generator so that it always generates the DeadEnd variant.
Let's give adventurers a reason to venture in your mazes.
Define the treasure generator so that it generates either Gold, Diamond or Friendship with equal probability.
Then, define the room generator so that it wraps the values generated by treasure in the Room variant.
And now for the heart and soul of a maze: branches.
The branch generator receives a Generator Maze argument, which is a generator able to generate an arbitrary maze.
Define the branch generator so that it generates a Branch variant containing several branches leading to mazes generated by its argument.
The number of branches should be between 2 and 4 (any more than that and the maze engineer would get angry), determined randomly with equal probability.
Time to do business.
Define the maze generator so that it generates a dead end 60% of the time, a treasure room 15% of the time and a branch 25% of the time.
The branches should generate new mazes using maze recursively.
Make sure to use deadend, room and branch in the generator.
Each branch contains on average 3 mazes, but only 25% of these will branch out again, which is less than one, so your generated mazes are likely to eventually end.
Your maze is nice, but it has some issues:
MazeMakerSupport.mazeDepth)Define the mazeOfDepth n generator so that it generates a maze of depth n.
Only the deepest level 0 should contain dead ends or treasure rooms (with equal probability), all other levels should be a branch containing mazes of depth n-1 generated recursively with mazeOfDepth.
Make sure to use deadend, room and branch in the generator.