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