Funktionalität: Grundlogik mit userinput als Platzhalter
This commit is contained in:
parent
8e53a45b56
commit
3d27dac239
39
Bop_it.py
39
Bop_it.py
@ -1,24 +1,49 @@
|
|||||||
import random
|
import random
|
||||||
|
|
||||||
def score(x):
|
def score(x):
|
||||||
return score
|
pass
|
||||||
|
|
||||||
def command_tilt():
|
def command_tilt():
|
||||||
pass
|
action = input()
|
||||||
|
if action == "0":
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
return -1
|
||||||
|
|
||||||
|
|
||||||
def command_blind():
|
def command_blind():
|
||||||
pass
|
action = input()
|
||||||
|
if action == "0":
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
return -1
|
||||||
|
|
||||||
def command_scream():
|
def command_scream():
|
||||||
pass
|
action = input()
|
||||||
|
if action == "0":
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
return -1
|
||||||
|
|
||||||
def command_spin():
|
def command_spin():
|
||||||
pass
|
action = input()
|
||||||
|
if action == "0":
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
return -1
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
score = 0
|
||||||
|
result = 0
|
||||||
print("Let's play a Round of 'Raspberry says'!")
|
print("Let's play a Round of 'Raspberry says'!")
|
||||||
list_command_choices = [command_tilt, command_blind, command_scream, command_spin]
|
list_command_choices = [command_tilt, command_blind, command_scream, command_spin]
|
||||||
print(random.choices(list_command_choices))
|
while result != -1:
|
||||||
|
score += result # war zuerst zwei Zeilen weiter unten, hat dann aber nach einer falschen Runde den Score erhöht
|
||||||
|
round = random.choice(list_command_choices)
|
||||||
|
result = round()
|
||||||
|
print(f"Game over! Your Score is {score}")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
main()
|
main()
|
||||||
Loading…
x
Reference in New Issue
Block a user