Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Program Specification: Write a program that allows a single Player (the user) to

ID: 646540 • Letter: P

Question

Program Specification:

Write a program that allows a single Player (the user) to play a simple three dice game of chance.

Game Description:
--There is a single player, with three twelve sided die.
-- The sides of each die are labeled with the numbers from 1 to 12, we will call this the value of the die.
--A game is made up of rounds, a single round is played as such:

1. The player rolls two of their dice.
2. The dice are displayed, in some reasonable format.
3. The player is asked if the third die roll will result in a value which is strictly between the values
of the rst two dice (already rolled) and their response is saved.
4. The player rolls their third die.
5. The die is displayed, in some reasonable format.
6. A determination is made as to whether or not the player won the round, this determination is
made via the following rules:
{ If the player guessed between, and the third die value is strictly greater than the smallest
of the rst two values and the third die value is strictly less than the largest of the rst two
values - then the player wins
{ If the player guessed not between, and the third die value is less than or equal to the smallest
of the rst two values or the third die value is greater than or equal to the largest of the
rst two values - then the player wins
{ If neither of the above two cases apply - then the player loses
7. The result of the round (with respect to the Player) is reported.

--The player is asked if they wish to play another round.

--Once the player indicates that they do not wish to play another round: Before exiting, the program
displays a short report stating how many rounds were played, of those - how many were won and
how many were lost.

Sample run(s):

Welcome to Computer Dice

--------------------------------------

First, You will roll two of your dice

Next, you must determined if the third

die will fall in between or not

Lastly, you will roll your last die

---------------------------------------

Player

----------

5 1

In between [y / n] : 3

In between [y / n] : no

In between [y / n] : n

9

Congrats, you win!

Do you wish to play again [y / n] : 5

Do you wish to play again [y / n] : yes

Do you wish to play again [y / n] : y

Player

----------

8 2

In between [y / n] : y

6

Congrats, you win!

Do you wish to play again [y / n] : y

Player

----------

10 11

In between [y / n] : y

6

Sorry, you lose!

Do you wish to play again [y / n] : n

Computer Dice Results

---------------------

You played 3 rounds

Rounds won : 2

Rounds lost : 1

---------------------

Explanation / Answer

You can answer many seemingly difficult questions quickly. But you are not very impressed by what can look like magic, because you know the trick. The trick is that your brain can quickly decide if question is answerable by one of a few powerful general purpose "machines" (e.g., continuity arguments, the correspondences between geometric and algebraic objects, linear algebra, ways to reduce the infinite to the finite through various forms of compactness) combined with specific facts you have learned about your area. The number of fundamental ideas and techniques that people use to solve problems is, perhaps surprisingly, pretty small

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote