This section is for developers who have experience with Matlab.
Explanation of Variables
- userchoice – stores the number of the option in the menu that the user chooses
- total – the total amount of money that the user has that day
- playAgain – stores whether the user wishes to play again or not
- bet – the amount of money the user wishes to bet on the roll
- estimatedDecision – the option of ‘Under 7’, ‘Over 7’, ‘Exactly 7’ that the user bets on
- roll – the values of the roll
- dicetotal – the total score of the two dice
- actualResult – the option of ‘Under 7’, ‘Over 7’, ‘Exactly 7’ that actually occurred
List of Game Commands Used
- fprintf() – prints out a statement to the command window
- strcmp() – compares if two strings are the same, and is equal to 1 if strings are the same and 0 if those strings are not the same
- input() – prints out a statement to the command window and a store’s the user input
- imshow() – shows an image
- randi() – randomizes an array of random integers based on the inputs sent in
References for this Section
“Rand.” Array of Random Integers – MATLAB Randi, www.mathworks.com/help/distcomp/randi.html.
“Simple Dice Games.” Simple Dice Games.docx | Powered By Box, app.box.com/embed/s/7xix47joqogepsui40xg5pp3sv9uv3rn?view=list&sortColumn=name&sortDirection=ASC&showItemFeedActions=true&showParentPath=true.