Jupyter weg
This commit is contained in:
16
Game/game.py
16
Game/game.py
@@ -4,19 +4,27 @@ 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):
|
||||
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(*'Kopf')
|
||||
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')
|
||||
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)
|
||||
coin_flip(propability, coins, coins_per_head, coins_amount, multiplier)
|
||||
|
||||
Reference in New Issue
Block a user