Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Once you figure out how this works, it is pretty easy. You need to realize that this is actually a 1 D array bent around

Once you figure out how this works, it is pretty easy.
You need to realize that this is actually a 1D array bent around a square.
Start 000000000000000
Create 2 parallel arrays. One for buttons and one for values. The button text matches the corresponding value.
At first, each element has a value of 0.
If the game rolls a 2, then the player, currently in spot 0, moves forward 2 spots and now is in spot 2 and that element increments by 1.
1010000000000000
If the game rolls a 5, then the player, currently in spot 2, moves forward 2 spots and now is in spot 7 and that element increments by 1.
1010000100000000
You will have to keep track of the playerPosition, since that is where the player is currently standing. Also, you will have to wrap when you get back to the beginning.
Addition: Add a button that rolls the die ONCE, and the results are all updated.
Notes: Your game board should have a roll dice button so that we can see the results of each roll at our leisure.
The 100 dice rolls (or 50, if you prefer) is to speed it up to see the results of your array manipulation.
Write your array contents to a text file, appending each go of the game so you have a record. See File Writing
Your game should have something happen on each die roll. It could be a color, an animation, anything.
There should be help so a user knows what is going on.
You need to update the array (that is what this is all about) and demonstrate that it worked.
GameBoard.PNG
c ) Advanced. Add another feature. Think 'Snakes and Ladders' or 'Monopoly'.
Submission: Submit your complete project, zipped, here, along with a screen shot of it running. Include a comment explaining part c).

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

Students also viewed these Databases questions