Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Matlab) need to modify the code: Player fails the game if you cannot make it within 3 tries. Player can do this game up to

(Matlab) need to modify the code: Player fails the game if you cannot make it within 3 tries. Player can do this game up to 10 times. If player input is larger than 10, it will display Dumb and immediately stop the game.

%-----------------------------------------------------------

while(1)

count=0;

guess=input('Guess a number between 0 to 10 ');

if(R>guess)

disp('Your guess is too small')

elseif (R

disp('Your guess is too large')

elseif (R==guess) disp('You are correct! It is '); guess

R=floor( rand()*10 );

end

count=count+1;

if(count==3)

break;

end

end

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 Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions

Question

Describe alternative training and development delivery systems.

Answered: 1 week ago

Question

When would you use one approach, and when would you use another?

Answered: 1 week ago

Question

3. How would this philosophy fit in your organization?

Answered: 1 week ago