Ganz Rudimentaerer Entwurf der Grundmechanik des Spiels
This commit is contained in:
BIN
Game/__pycache__/menu.cpython-313.pyc
Normal file
BIN
Game/__pycache__/menu.cpython-313.pyc
Normal file
Binary file not shown.
22
Game/game.py
Normal file
22
Game/game.py
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#import menu
|
||||||
|
import random
|
||||||
|
|
||||||
|
propability = 40
|
||||||
|
coins_per_head = 0.5
|
||||||
|
coins = 5
|
||||||
|
|
||||||
|
def coin_flip(propability, coins, coins_per_head):
|
||||||
|
while True:
|
||||||
|
result = random.randint(0, 100)
|
||||||
|
if result in range(0,propability):
|
||||||
|
print(*'Kopf')
|
||||||
|
coins += coins_per_head
|
||||||
|
print('')
|
||||||
|
print(f'Du hast {coins} coins')
|
||||||
|
input()
|
||||||
|
elif result in range(propability,100):
|
||||||
|
print('Zahl')
|
||||||
|
input()
|
||||||
|
|
||||||
|
|
||||||
|
coin_flip(propability, coins, coins_per_head)
|
||||||
Reference in New Issue
Block a user