Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

image text in transcribed

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.rb

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2005 For Windows Mobile Web Office And Database Applications Comprehensive

Authors: Gary B. Shelly, Thomas J. Cashman, Corinne Hoisington

1st Edition

0619254823, 978-0619254827

More Books

Students also viewed these Databases questions