Write a MATLAB script Classic program that will play the fol

Write a MATLAB script (Classic program) that will play the following simple dice game. The following is repeated until the player choices to quit - via a user validation loop. The Player rolls two six sided die and their values are displayed The Computer rolls two six sided die and their values are displayed A determination is made as to whether the player has won, lost, or tied based on the following rules Any pair beats any non-pair Two pairs are compared by their common values - high beats low/same ties Two non-pairs are not compared and just result in a tie The result of the round is displayed After the Player chooses to quit a brief report is displayed indicating how many times the play won, lost and tied. Sample Run. Player: 4 2 Computer: 6 6 Player lost! Do wish to paly again Do wish to play again Player: 3 3 Computer: 1 5 Player won! Do you wish to play Player: 4 4 Computer: 2 2 Player won! Do you wish to paly again?: y Player: 3 5 Computer: 6 4 Player tied! Do you wish to play again?: n Won: 2 Lost: 1 Tied: 1

Solution

Answer :

For looping ;

 Write a MATLAB script (Classic program) that will play the following simple dice game. The following is repeated until the player choices to quit - via a user

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site