Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 MATLABimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Transaction Processing

Authors: Philip M. Lewis, Arthur Bernstein, Michael Kifer

1st Edition

0201708728, 978-0201708721

More Books

Students also viewed these Databases questions

Question

2. What recommendations will you make to the city council?

Answered: 1 week ago