''' DS2000 Fall 2024 October 8, 2024 Starter code for class -- let's call a function we've never seen before. Given name, parameters, and return type we can call ANY function! ''' import random import matplotlib.pyplot as plt WIN = "win!" LOSE = "lose:(" DRAW = "draw" def point_result(point, w, l, d): ''' Parameters: sum of two dice (int), called the "point", strings for w/l/d Returns: a string (win, lose, or draw) Does: determines whether the point wins, loses, or ties ''' if point == 7 or point == 11: return w elif point == 2 or point == 3 or point == 12: return l else: return d def generate_craps(num_rolls): ''' Parameters: number of times to roll two six-sided dice Returns: a list of ints (sums) Does: Rolls two 6-sided dice the given number of times and appends their sums to a list ''' sums = [] for i in range(num_rolls): roll1 = random.randint(1, 6) roll2 = random.randint(1, 6) sums.append(roll1 + roll2) return sums