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

 Exercise 1: Write a program to generate 12x12 random mazes. There

Exercise 1: Write a program to generate 12x12 random mazes. There are multiple approaches to complete this operation. Your program must generate random mazes using the following steps: (6 Marks) 1. Choose a random wall (vertical or horizontal) between two cells. a. If the cells on each side of that wall are already in the same set, do nothing. b. If the cells on each side of the wall are not in the same set: i. demolish the wall, and ii. merge the sets containing those two cells. 2. Continue choosing random walls until all cells are in the same set. Some sample outputs are provided below for your reference: Sample Output 1: _l_l_ _I_ I _ I_I_I_ | __i_ | -I_ |_| |_ |_ | |_ I _L _ 1 IL | |_ |_I_I. I_I__IL

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!