Improve betting code, hard-limit bets at 50 million

This commit is contained in:
Firepup Sixfifty 2024-06-03 15:54:48 -05:00
parent ff743dfbc1
commit 97a4995f07
Signed by: Firepup650
GPG key ID: 7C92E2ABBBFAB9BA

34
game.py
View file

@ -107,35 +107,11 @@ while 1:
print("Press any key to exit") print("Press any key to exit")
get() get()
case 2: case 2:
bet = menu({"5": 5, "10": 10, "20": 20, "30": 30, "40": 40, "50": 50, "60": 60, "70": 70, "80": 80, "90": 90, "100": 100, "1000": 1000, "Exit": "E"}, "How many studs would you like to bet?") print("Calculating avaliable bets, this shouldn't take long...")
betHigh = 0 bets = {str(i): i for i in range(5, min(uData["studs"], 50000000), 5)}
match bet: bets["Exit"] = "E"
case 5: bet = menu(bets, "How many studs would you like to bet?")
betHigh = 10 betHigh = 0 if type(bet) != int else bet*2
case 10:
betHigh = 20
case 20:
betHigh = 40
case 30:
betHigh = 60
case 40:
betHigh = 80
case 50:
betHigh = 100
case 60:
betHigh = 120
case 70:
betHigh = 140
case 80:
betHigh = 160
case 90:
betHigh = 180
case 100:
betHigh = 200
case 1000:
betHigh = 2000
case _:
betHigh = 0
winnings = 0 winnings = 0
betLow = -bet if betHigh else 0 betLow = -bet if betHigh else 0
while betHigh: while betHigh: