Question: Analyze a basic set of requirements and apply top - down design principles for a problem Customize and define C functions Apply the 3 -
Analyze a basic set of requirements and apply topdown design principles for a problem
Customize and define C functions
Apply the file format: header file and source files
Open and close files
Read, write to and update files
Apply standard library functions: fopen fclose fscanf and fprintf Compose decision statements if conditional statements
Create and utilize compound conditions
Develop and implement an interactive twoplayer Yahtzee game. Yahtzee is a dice game that was invented by Milton Bradley and Edwin S Lowe in The challenge of the game is to outduel the other player by scoring the most points. Points are obtained by rolling five sided die across thirteen rounds. During each round, each player may roll the dice up to three times to make one of the possible scoring combinations. Once a combination has been achieved by the player, it may not be used again in future rounds, except for the Yahtzee combination may be used as many times as the player makes the combination. Each scoring combination has different point totals. Some of these totals are achieved through the accumulation of points across rolls and some are obtained as fixed sequences of values.The Rules of Yahtzee:
The scorecard used for Yahtzee is composed of two sections. A upper section and a lower section. A total of thirteen boxes or thirteen scoring combinations are divided amongst the sections. The upper section consists of boxes that are scored by summing the value of the dice matching the faces of the box. If a player rolls four s then the score placed in the s box is the sum of the dice which is Once a player has chosen to score a box, it may not be changed and the combination is no longer in play for future rounds. If the sum of the scores in the upper section is greater than or equal to then more points are added to the players overall score as a bonus. The lower section contains a number of poker like combinations. Three of a kind they're dice with the same face score: sum of all face values on the dice. Four of a kind four dice with the same face score: Sum of all face values on the dice.
Full house One pair and a threeofakind Score: Small straight A sequence of four dice score: Large straight : A sequence of five dice score: Yahtzee think five ofakind Five dice with the same face score: Chance. May be used for any sequence of dice; this is the catch all combination Score: Sum of all face values on the dice. What is required for this assignment?
You may design the Yahtzee game with functions that you see fit. I recommend that you start with a structure chart and determine subproblems and functions. accordingly. You must also take advantage of applying pointers, output parameters, andor arrays! Your Yahtzee game must also implement the following algorithm:
pts Print a game menu for Yahtzee with the following options: Print game rules
Start a game of Yahtzee
Exit
pts Get a menu option from the user; clear the screen
pts If option is entered, then print the game rules stated above and repeat step
otherwise if option is entered, then continue on to step ; player starts the game
otherwise if option is entered, then print a goodbye message and quit the program
otherwise repeat step
pts Ask the player to hit any key to continue on to roll the five dice
pts Roll the five dice and display the face values of each die; enumerate each die with a number ; add to the total number of rolls for this round
pts If the total number of rolls for this round is less than three,
then ask the player YN if heshe wants to use the roll for one of the game combinations
otherwise a combination must be selected.
Sum of s Sum of s Sum of s Sum of s Sum of s Sum of s
Threeofakind Fourofakind Full house
Small straight Large straight Yahtzee
Chance
pts If the number of rolls is three or "yes" is entered, then save the combination and it may not be selected again in the future
Note: The selection of the combination must be verified. If the user selects full house, but does not have one, then you must assign points for the combination;
continue on to step ; clear the screen
otherwise if no is entered, ask the user which dice to reroll ; reroll the
selected die or dice; clear the screen; repeat step
pts Alternate players
pts If each player has rolled for the round, then increment the round number
if the round number is equal to then continue on to step
otherwise repeat step otherwise repeat step
pts If the total score in the upper section is greater than or equal to for a player, then add points to the total score
pts Print the scores for both players and print the winner
pts Repeat step
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
