32 lines
951 B
Python
32 lines
951 B
Python
#import menu
|
|
import random
|
|
|
|
propability = 40
|
|
coins_per_head = 0.5
|
|
#wealth = 5000
|
|
heads_amount = 1
|
|
multiplier = 0.5
|
|
|
|
def coin_flip(propability, wealth, coins_per_head, heads_amount, multiplier):
|
|
while True:
|
|
result = random.randint(0, 100)
|
|
if result in range(0,propability):
|
|
print(f'Kopf ({heads_amount}x)')
|
|
heads_amount += 1 #Anzahl an hintereinander geworfenen "Köpfen"
|
|
if heads_amount >=3:
|
|
coins_per_head += multiplier #Coin-Boost für mehrfaches werfen von Kopf hintereinander
|
|
else:
|
|
coins_per_head = 0.5
|
|
wealth += coins_per_head
|
|
print('')
|
|
print(f'Du hast {wealth} Coins (+ {coins_per_head})')
|
|
input()
|
|
elif result in range(propability,100):
|
|
print('Zahl')
|
|
heads_amount = 1
|
|
input()
|
|
|
|
|
|
coin_flip(propability, wealth, coins_per_head, heads_amount, multiplier)
|
|
|