Question: Design a simple game that uses two dice ( each die with 6 sides, the common dice used in games ) . Rolling a die

Design a simple game that uses two dice (each die with 6 sides, the common dice used in games). Rolling a die is of course going to require generating random numbers.
The player(s) wins only when both dice take turns as they are rolled and result in matching numbers. Create two buttons and allow the player(s) to click on each button alternatively. The user will not be allowed to click the same button more than two times at most. The user will be allowed to roll each dice as many times as needed, the best result is to see matching numbers ASAP. You can have two or more players and count how many times each player clicked before the winning result is achieved. The winner is the player that gets the matching numbers, with the least number of clicks.
1) Sample page: Page loads with both buttons, no results before user clicks.
Click either button to roll the dice.
2) Sample page: After user clicks the first button (dice#1).
3) Sample page: After user clicks the second button (dice#2).
4) Sample page: After the user clicks both buttons alternatively several times, as a result matching numbers appear.
Dice#1 Dice#2
Design a simple game that uses two dice ( each

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 Programming Questions!