Program Specication:
Write a program that allows a single Player (the user) to play a simple two dice game of chance against
"The Odds".
Game Description:
There is a single player, with two six sided die.
The sides of each die are labeled with the numbers from 1 to 6, 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 their two dice.
d1 = (int)(Math.random() * 6) + 1;
d2 = (int)(Math.random() * 6) + 1;
d1, d2 declared as type int before the game loop.
2. The dice are displayed, in some reasonable format.
3. A determination is made as to whether or not the player won the round, this determination is
made via the following rules:
{ A Pair is when both dice have the same number on their top faces. If the player has any
pair then they win the round.
{ A Straight is when both dice have a dierent number on their top faces - but they are
consecutive numbers. If the player has any Straight then they neither win nor lose the
round.
{ A Junker is then anything that is not a Pair or a Straight. If the player has any Junker
then they lose the round.
4. 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
-------------------------------------
You will first roll your dice
Next the outcome of your roll will
be determined:
any Pair and you Win
any Straight and you just roll again
anything else and you Lose
--------------------------------------
Player
--------
5 1
Sorry, you lose!
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
--------
2 6
Sorry, you lose!
Do you wish to play again [y, n] : y
Player
--------
4 4
Congrats, you win!
Do you wish to play again [y, n] : y
Player
--------
3 2
Its a tie!
Do you wish to play again [y, n] : y
Player
--------
2 3
Its a tie!
Do you wish to play again [y, n] : n
Computer Dice Results
---------------------
You played 5 rounds
Rounds won : 1
Rounds lost : 2