• 11/9/2021 Nightly Build

    0 Open
    0 Closed

    Not sure if this is the correct format but I know this is broken.

    # This program is a probability game for statistical interpretation
    # It is only single player (Currently)
    # 
    
    # Here it imports the random library
    import random
    def player_one_start():
        # Here it sets needed values and does math for total
        player_one_start.var = "no"
        card_one = random.randint(1,11)
        card_two= random.randint(1,11)
        hand_one = [card_one, card_two]
        card_ammount = 2
        current_card = 0
        total = hand_one[0] + hand_one[1]
        
        # Here the users is told their numbers
        print("Your hand is: " + str(hand_one))
        
        # Here it sees if the users wants another "card" (Number)
        option = input("Do you want another card? (Y or N) ")
        
        # Here if the users wants a number they get a number
        if option == "Y" or option == "y":
            current_card = random.randint(1,11)
            print("You drew a(n): " + str(current_card))
            hand_one.append(current_card)
            total = total + current_card
            if total > 21: 
                print("You went over")
                player_one_start.var = "yes"
        elif option =="N" or option == "n":
            player_one_start.var = "yes"
        return(player_one_start.var)
        
    def player_two_start():
        # Here it sets needed values and does math for total
        card_one = random.randint(1,11)
        card_two= random.randint(1,11)
        hand_one = [card_one, card_two]
        card_ammount = 2
        current_card = 0
        total = hand_one[0] + hand_one[1]
        
        # Here the users is told their numbers
        print("Your hand is: " + str(hand_one))
        
        # Here it sees if the users wants another "card" (Number)
        option = input("Do you want another card? (Y or N) ")
        
        # Here if the users wants a number they get a number
        if option == "Y" or option == "y":
            current_card = random.randint(1,11)
            print("You drew a(n): " + str(current_card))
            hand_one.append(current_card)
            total = total + current_card
            if total > 21: 
                print("You went over")
        
        
        
        print("Your hand is: " + str(hand_one) +" or " + str(total) +" total.")
    while player_one_start.var != yes:
        player_one_start()
    """
    Possibly have it go like this
    while player_one_start.var != yes:
        player_one_start()
        player_one_hold?()
        player_two_start()
        player_two_hold?()
        etc.
        
    Only issue is it would reset the cards
        Could save as 
    
    
    We should only have 7 players, possibly generate a player_number_option()? or do AI
    """