Question: MATLAB - Write code to perform a complete game of Yahtzee in MATLAB The program should be able to do the following: 1. roll five

MATLAB - Write code to perform a complete game of Yahtzee in MATLABMATLAB - Write code to perform a complete game of Yahtzee in

The program should be able to do the following: 1. roll five dice up to three times, permitting the player to select which dice to keep between each roll; 2. ask the player if they wish to roll again, or score the roll; 3. when the turn is complete, ask the player which entry they wish to make in their score sheet (e.g., ones, twos, ... full house, small straight, large straight... etc.); 4. determine if the player can make the entry they selected (e.g., if the player ends with 1, 2, 3, 4, 6 and asks to take a large straight, the program should tell them they do not have the dice make that entry, and ask again. Alternatively, the program can identify which rolls the player can take and advise them accordingly.); 5. recognize when each entry in the yahtzee score sheet has been filled, and deny a player from making a redundant entry (except for a yahtzee, which adds 100 to the score for each subsequent yahtzee rolled); 6. print the score sheet to the screen showing all scores tallied after each roll; 7. identify when the game has ended and print the final score sheet, announcing the game has ended

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