Answered You can hire a professional tutor to get the answer.

QUESTION

Round the Clock Dice Game (Using MATLAB) Round the Clock is a very simple game played with two dice.

 Round the Clock Dice Game (Using MATLAB)

Round the Clock is a very simple game played with two dice. The players take turns rolling the dice and try to get all of the numbers on a clock face (1 through 12). Players first try to roll a one. Once a player has rolled a one, (s)he moves on to trying to roll a two on the next turn. Play continues until someone has rolled all of the numbers. Numbers can be rolled on a single die or by adding the values of the two dice. For simplicity, we will only have one player and simulate how long it will take to finish the game.

Do a script that does the following:

1.    Includes this command: rng('shuffle'). This command randomly seeds the random function you will be using.

2.    Displays to the user the current value (s)he is attempting to roll.

3.    Rolls the dice: Dice1 = randi([1 6],1); Dice2 = randi([1 6],1);

Note: randi([1 6],1) creates one integer value in the range of 1 to 6.

4.    Outputs to the user the values of the two dice.

5.    Checks and displays if the user has completed the current phase or needs to make another attempt.

6.    Pause for 1 second: pause(1);

7.    Repeat steps 2 through 6 until the player has rolled all 12 values.

8.    Display how many turns it took to finish.

9.    Run your script several times to test it.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question