Question: Javascript (DOM) Game Creation: Instruction as below: Assignment 03: Find the Coin! For this assignment you will be creating a simple game of chance that

Javascript (DOM) Game Creation: Instruction as below:

Assignment 03: Find the Coin!

For this assignment you will be creating a simple game of chance that the user can play in their browser. The rules for the game are as follows:

  • The user starts with a bank value of $50
  • The user is presented with three red solo cups. Behind one of the cups is hidden a small coin. The coin should be randomly placed behind one of the cups when the page loads.
  • The user is asked to select one of three cups by clicking their mouse on the desired cup
  • If they find the coin they earn $5. If they do not find the coin they lose $5.
  • The user can then click a "Play Again" button to try another round. The coin is then re-randomized and placed behind another (or the same) cup for the next round.
  • The user can continue to play as long as they have money in their bank. If the user runs out of money your program should not allow them to select another cup. Display some kind of "game over" message when this happens. Hint: test your program with a lower initial bank amount to make sure this feature works correctly!

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!