Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please post written or typed script from MATLAB Write a script that will play a single game of what I call dumb Yahtzee. In this

image text in transcribedPlease post written or typed script from MATLAB

Write a script that will play a single game of what I call "dumb Yahtzee". In this game, you will roll 5 dice on each turn. You will start with zero points. For your first turn, you add up the total of all dice that show a 1 and add this to your total score. For your second turn, you add the total of all dice that show a 2, You will take 6 turns. Print the final score to the command window at the end of the game. For instance, on turn 3, you roll: 14363 There are two 3's on this roll resulting in 2 x 3 = 6 points added to your total score. Hint - The MATLAB function randi (6,1) will simulate the rolling of one 6-sided dice. The function randi (6,1,5) will roll 5 of these dices. (I know, the plural is dice and the singular is die. But I don't want to confuse anyone here with my fancy East Coast grammar.)

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions