Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started