# this program can NOT run by itself!  # ➊➋➌

def calculate_score(dice, name_of_option): # ➍
    """calculate how much points an option would score using dice""" # ➎   
    # assert expression, error_message
    assert len(dice) == 5, f"{dice} must have five elements" # ➏
    error_message = f"{dice} must have only integers"
    assert [type(x) for x in dice] == [int,int,int,int,int], error_message # ➐
    error_message = f"{name_of_option} must be in {all_options.keys()}"
    assert name_of_option in all_options, error_message # ➑

    # joker rule?
    option_list = list(all_options) # ➒
    joker = False
    upper_name = option_list[dice[0]-1] # ➓
    if all((is_yahtzee(dice),           # ⓫
            "Yahtzee" in history,
            upper_name in history)):
        joker = True
    match name_of_option:               # ⓬
        # first test the lower section options
        case "Three Of A Kind":
            return sum(dice) if is_three_of_a_kind(dice) else 0 # ⓭
        case "Four Of A Kind":
            return sum(dice) if is_four_of_a_kind(dice) else 0
        case  "Full House":
            return 25 if (is_full_house(dice) or joker) else 0
        case  "Small Straight":
            return 30 if (is_small_straight(dice) or joker) else 0
        case "Large Straight":
            return 40 if (is_large_straight(dice) or joker) else 0
        case "Yahtzee":
            return 50 if is_yahtzee(dice) else 0
        case "Chance":
            return sum(dice)
        case _:  # ⓮
            # it's an upper section option:  Ones, Tows, ... Sixes
            number = option_list.index(name_of_option) + 1 # ⓯
            return dice.count(number) * number             # ⓰
