C. Program Description for Developers

This section is for developers who have experience with Matlab.

Explanation of Variables

  1. userchoice – stores the number of the option in the menu that the user chooses
  2. total – the total amount of money that the user has that day
  3. playAgain – stores whether the user wishes to play again or not
  4. bet – the amount of money the user wishes to bet on the roll
  5. estimatedDecision – the option of ‘Under 7’, ‘Over 7’, ‘Exactly 7’ that the user bets on
  6. roll – the values of the roll
  7. dicetotal – the total score of the two dice
  8. actualResult – the option of ‘Under 7’, ‘Over 7’, ‘Exactly 7’ that actually occurred

List of Game Commands Used

  1. fprintf() – prints out a statement to the command window
  2. 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
  3. input() – prints out a statement to the command window and a store’s the user input
  4. imshow() – shows an image
  5. 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.