from random import randint

balance = 100
day = 1

print ("Welcome to Gold Rush!")

while (balance > 0):
    print ("DAY", day)
    portal = input("Choose a portal (1/2/3): ")
    chance = randint(1, 10)

    if (portal == "1"):
        if (chance <= 8):
            print ("You won 2x your money!!")
            balance = balance * 2
        else:
            print ("You lost $300!!!")
            balance = balance - 300
    elif (portal == "2"):
        if (chance <= 8):
            print ("You win $400!!!")
            balance = balance + 400
        elif (chance == 9):
            print ("You lose $500!!!!!")
            balance = balance - 500
        else:
            print ("You lose 20% of your money!!")
            balance = balance * 0.8
            
    elif (portal == "3"):
        if (chance == 1):
            print ("Your money got quadrupled!!!!")
            balance = balance * 4
        elif (chance <= 4):
            print ("You lose half your money!!")
            balance = balance * 0.5
        elif (chance <= 9):
            print ("You win $2000!!!!")
            balance = balance + 2000
        else:
            print ("You died!!!")
            break

    print ("Current balance: $", balance, sep="")
    day = day + 1
    print()
    
print ("You survived for", day-1, "days. Better luck next time!!!")
