Question: java 3. EXERCISES Exercise 1: Write a program to generate 9x9 random mazes. There are multiple approaches to complete this operation. Your program must generate


3. EXERCISES Exercise 1: Write a program to generate 9x9 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 9x9 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 from a 10x10 maze are provided below for your reference: Sample Output 1: 1 1 1 + 1 1 1 1 1 1 + 1 1 +-+ 1 1 + 1 + 1 + 1 --+ + 1 1 --+---+ + 1 +- Sample Output 2: 1 + IT 1 + 1 + + +---+ 1 I T 1 1 1 1 1 1 1 +- + + + 1 1 1 1 1 A video demonstration (filename: 6x6 Maze.mov) to understand the working of Steps 1 through 4 have been included as a separate file. The video demonstrates a smaller maze for ease of understanding. Note: While writing the solution, the following conventions MUST be followed 1. The entire exercise must be completed using only a single.java/txt file 2. The class that contains the main() must be named assignmaze 3. The assignmaze class should be created in the assignment package ***END OF EXERCISE 1*** CSCI 1301 - Object Oriented Programming ASSIGNMENT | Semester 1 2021/2022 3.1 EXERCISE 2 INSTRUCTIONS: Exercise 2 is a bonus question and not compulsory It has been included for you to score bonus marks This exercise has 2 marks The marks for this exercise will be only given, if you score at least 5 Marks in Exercise 1 Should you score full marks for Exercise 1, the bonus marks will be added to your overall result Exercise 2: A dry run is the process of a programmer manually working through their code to trace the value of variables. There is no software involved in this process. Your job is to dry run the solution for Exercise 1. Note: Submit the solution for this exercise as a .pdf file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
