Session Ready
Exercise

Function to run one round

Now, let us use the function from the previous exercise, and write one overall function, called evaluate_first_roll, to complete one round of Craps. As seen in the sample code below, this function will take the shooter's first roll as its input, and proceed accordingly from there. The roll_dice and roll_after_point functions have been preloaded for you.

Instructions
100 XP
  • Use the %in% operator to check whether the roll is a 7 or 11, resulting in an immediate win.
  • Use the %in% operator to check whether the roll is a 2, 3, or 12, resulting in an immediate loss.
  • If a point is established, continue rolling until either the point is rolled again, resulting in a win, or a 7 is rolled, resulting in a loss.