Question
Step 1: The code in the initialize() procedure of the Gosu window should be completed to set up cells that are connected to each other
Step 1: The code in the initialize() procedure of the Gosu window should be completed to set up cells that are connected to each other with variables joining each cell to its neighbours (using references).
Step 2: The user should be able to left-click on cells on the screen to create mazes (and later in the Maze Search task we will use recursion to find a path through the maze).
Step 3: Each cell clicked on should turn yellow.
Step 4: Once this is working (or perhaps before) add code to print out each cell and indicate whether the reference to the neighbour on each side is nil or not, as per the following:
In this case, there is no neighbour to the north or the west.
Please answer this with steps and a straightforward answer. Any other responses will be subject to reporting.
You must complete the code provided so that it works as follows: Step 1: The code in the initialize() procedure of the window should be completed to set up cells that are connected to each other with variables joining each cell to its neighbours (using references). Step 2: The user should be able to left-click on cells on the screen to create mazes (and later in the Maze Search task we will use recursion to find a path through the maze). Step 3: Each cell clicked on should turn yellow. Step 4: Once this is working (or perhaps before) add code to print out each cell and indicate whether the reference to the neighbour on each side is nil or not, as per the following: Cellx:0,y:north:south:1east:1west: In this case, there is no neighbour to the north or the west. (i) Note: Whether the east or the west neighbour is nil will depend on your perspective, i.e. is your perspective looking into the screen, or out of the screen. Your submitted screenshot should look something like the following: (b) Stop Online (1) maze_creation.rbStep 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