Question: Exercise 1: Write a program to generate 10x10 random mazes. There are multiple approaches to complete this operation. Your program must generate random mazes using

 Exercise 1: Write a program to generate 10x10 random mazes. There

Exercise 1: Write a program to generate 10x10 random mazes. There are multiple approaches to complete this operation. Your program must generate random mazes using the following steps: 1. Choose a starting point/cell in your 10x10 matrix. Mark this cell as visited. 2. Each cell has four walls. Choose one of the walls randomly and carve a passage through to get to the adjacent cell, only if the adjacent cell has not been visited yet. This will become your new current cell 3. if all four adjacent cells have been visited, back up to the last cell that has uncarved walls and repeat 4. The program ends when you reach back to the starting point/cell Some sample outputs are provided below for your reference: Sample Output 1: 1 1 1 1 + 1 +- 1 1 I + 1 1 1 + + 1 1 1 + 1 1 + 1 + 1 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!