We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Break Walls

Next we need to break down enough walls that the maze is fun and challenging while also ensuring that there is a correct path from the start to the end.

We'll use some randomness so that the maze is new and fun each time!

Seeding Randomness

Randomness is fun, but it can be tough to debug your application if each time you run it, it behaves slightly differently. We'll add an optional "seed" parameter that can be toggled on and off to ensure that the randomness behaves the same every time when seeded. It will only be used for testing and debugging.

Assignment

The fixed seed can be anything, say 0, but because its fixed, it will ensure you always get the same "random" numbers when you use the random library. Once you're done debugging and want randomness for your application, you can just leave the seed parameter blank in main to get real randomness again.

Testing Your Solution

Once you have implemented the changes above, run your code to see the maze generation in action. If everything is working properly, each run with the same seed should produce identical mazes, while using no seed will result in a different maze each time.

Tips

Here's my pseudo code for the __break_walls_r method: