From 3d27dac239c3b05aa14b03158b0c061e9c9ecf36 Mon Sep 17 00:00:00 2001 From: Franziska Gerold Date: Tue, 16 Dec 2025 20:51:05 +0100 Subject: [PATCH] =?UTF-8?q?Funktionalit=C3=A4t:=20Grundlogik=20mit=20useri?= =?UTF-8?q?nput=20als=20Platzhalter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bop_it.py | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/Bop_it.py b/Bop_it.py index 268d394..f10951b 100644 --- a/Bop_it.py +++ b/Bop_it.py @@ -1,24 +1,49 @@ import random def score(x): - return score + pass def command_tilt(): - pass + action = input() + if action == "0": + return 1 + else: + return -1 + def command_blind(): - pass + action = input() + if action == "0": + return 1 + else: + return -1 def command_scream(): - pass + action = input() + if action == "0": + return 1 + else: + return -1 def command_spin(): - pass + action = input() + if action == "0": + return 1 + else: + return -1 def main(): + score = 0 + result = 0 print("Let's play a Round of 'Raspberry says'!") - list_command_choices = [command_tilt, command_blind, command_scream, command_spin] - print(random.choices(list_command_choices)) + list_command_choices = [command_tilt, command_blind, command_scream, command_spin] + 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() \ No newline at end of file