Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a C program that allows a single Player (the user) to play a simple three dice game of chance against The Odds. 1.
Write a C program that allows a single Player (the user) to play a simple three dice game of chance against "The Odds". 1. There is a single player, with three eight sided dice. 2. The sides of each die are labeled with the numbers from 1 to 8, we will call this the value of the die. 3. A game is made up of rounds, a single round is played as such: a) The player rolls their three dice b) The dice are displayed, in some reasonable format. c) A determination is made as to whether or not the player won the round, this determination is made via the following rules: i. A Triple is when all the dice have the same number on their top faces. If the player has any Triple then they win the round. ii. A Straight is when the numbers on the three dice faces can be arranged to form a consecutive sequence like 1 2 3 or 3 4 5 If the player has any Straight then they win the round. iii. A Pair is when any (exactly) two dice have the same number on their top faces. If the player has any Pair then they neither win nor lose the round. iv. A Junker is then anything that is not a Triple, a Straight or a Pair. If the player has any Junker then they lose the round. d) The result of the round (with respect to the Player) is reported. 4. The player is asked if they wish to play another round. 5. 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started