Question: Implement the following recursive algorithm to randomly generate a maze. In the example below I have made the maze 10x10 to save space but your

 Implement the following recursive algorithm to randomly generate a maze. In

the example below I have made the maze 10x10 to save space

but your maze should be 40x40. Start with a 2D array of

char like we used previously and assign walls to the borders: 0

X 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X ON min 00 x 9 x x x x x x x x x x Call the recursive function with parameters that specify the blank area in the middle, in this case, highlighted by yellow below. You could do this a

Implement the following recursive algorithm to randomly generate a maze. In the example below I have made the maze 10x10 to save space but your maze should be 40x40. Start with a 2D array of char like we used previously and assign walls to the borders: 0 X 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X ON min 00 x 9 x x x x x x x x x x Call the recursive function with parameters that specify the blank area in the middle, in this case, highlighted by yellow below. You could do this a couple of ways, for example, pass in the coordinates of the upper left and lower right corner, or pass in the coordinate of the upper left corner plus the width and height of the area. 0 1 2 3 4 5 6 7 8 9 X X X X X X X X X X x | x | x | x | x | x | x | x | x | x | If the width of the yellow area is

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!