Question: Write a MATLAB program to simulate the Beat That! game that can: Use three ( 3 ) 6 - sided dice to play the game

Write a MATLAB program to simulate the Beat That! game that can:
Use three (3)6-sided dice to play the game between a player and a computer.
Greet the player and briefly explain how to play the game when the game starts ?[4pt].
Allow the player to press any key on the keyboard then hit the Enter key to play ?[4pt]. Press q or Q then hit the Enter key to quit ?[4pt]. Directly hitting the Enter key to play is optional.
Generate three (3) random integers between 1 and 6 to represent the face value of rolling three dice.
Roll three dice for the player ?[4pt] and print the three (3) dice values on screen ?[4pt].
Roll three dice for the computer ?[4pt] and print the three (3) dice values on screen ?[4pt].
Sort the player's dice values in acceding or descending order ?[4pt]. For example, a roll of 3,2 and 6 can be sorted to 6,3 and 2.
Sort the computer's dice values in acceding or descending order ?[4pt].
Compute the best value rolled for the player ?[4pt]. For example, the sorted values of 6,3 and 2 can be combined into 632.
Compute the best value rolled for the computer ?[4pt].
Print the player's best value on screen ?[4pt].
Print the computer's best value on screen ?[4pt].
Compare the player's best value and the computer's best value and select a winner ?[4pt]. It is also possible that the match is a tie.
Print the match result on screen ?[2pt]. For example, the player wins, the computer wins, or the match ends in a tie.
Allow the player to press any key on the keyboard then hit the Enter key to play ?[4pt] and press q or Q then hit the Enter key to quit again. The game should allow the player to play one round after another ?[4pt] without any pre-set value to limit the total number of rounds the player can play ?[4pt].
Track the game statistics. Count the total number of rounds being played ?[4pt], the number of rounds the player won ?[4pt], the number of rounds the computer won ?[4pt], and the number of rounds ended in ties ?[4pt].
When the player decides to press q or Q to quit playing, the game should end ?[4pt]. Greet the player farewell ?[2pt] and print the total number of rounds played ?[2pt], the number of rounds the player won ?[2pt], the number of rounds the computer won ?[2pt], and the number of rounds ended in ties on screen ?[2pt].
Write a MATLAB program to simulate the Beat That!

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