Question: Write a MatLab code for Over 7 and under 7 using the provided instructions and commands Simple Dice Games Graphics Options: Save the Dice.mat file

Write a MatLab code for Over 7 and under 7 using the provided instructions and commands  Write a MatLab code for Over 7 and under 7 using

Simple Dice Games Graphics Options: Save the Dice.mat file to your current MATLAB directory. load Dice; % Loads cell array (1x6) of dice images >> roll: randi( [1 6] J1 21) % Random roll of 2 dice-only allow values from 1 to 6 roll 5 >> imshow( [ Dice(roll) ] ); % Displays the roll graphically for user 1. The game is played with two dice 2. The player specifies how much money he/she is betting on the roll 3. The player bets whether he/she will roll Under 7,Over 7, or Exactly7 4 The player specifies how much money he/she is betting on the roll 5. The player rolls the dice 6. If the player bets incorrectly, he/she loses the amount of money in the bet 7. If the player bets correctly, the payoff is 1:1 for Under 7 and for Over 7 (that is, if the bet was SI then the player wins $1) and is 4:1 for Exactly 7 (that is, if the bet was SI then the player wins $4 for betting on and successfully rollimg a 7), Player can start game with any amount of money, and can bet any amount (

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