From 6efc45ec2ec4b482eda1a5f956d5763eccc155cf Mon Sep 17 00:00:00 2001 From: Steinadler Date: Fri, 15 Jan 2021 15:29:12 +0100 Subject: [PATCH] fixed bug in clean_input.py for empty card selection. print formatting in quartett.py --- clean_input.py | 5 ++++- quartett.py | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/clean_input.py b/clean_input.py index 45027c4..1e196c7 100644 --- a/clean_input.py +++ b/clean_input.py @@ -81,7 +81,10 @@ def io_card_selection(message: str): while True: user_input = input(message) - if user_input[0] in "0123" and user_input[1] in "abcdefgh": + if user_input == "": + print("Eingabe nicht gültig, bitte wiederhole deine Eingabe.") + + elif user_input[0] in "0123" and user_input[1] in "abcdefgh": for c in card_stack: if c["number"] == user_input[0] and c["letter"] == user_input[1]: return c diff --git a/quartett.py b/quartett.py index 1391a6f..5ca8828 100644 --- a/quartett.py +++ b/quartett.py @@ -74,6 +74,7 @@ def round(card_stack, players_with_cards, players, active, complete_card_stack, switch = True while switch: + print("") players_without_active = copy.copy(players) players_without_active.pop(active) @@ -355,6 +356,7 @@ def the_winner_is(players_with_cards, players): # winners then functions as a template # to print all the players' names who have won + print("") for i in range(len(winners)): if winners[i] == temp: if players[i] == "player0": @@ -366,8 +368,8 @@ def the_winner_is(players_with_cards, players): def end_screen(): - clean_input.io_str("Möchten Sie das Spiel beenden oder ein neues Spiel starten?" - "Drücken Sie 'q' zum Beenden oder 'r'," + clean_input.io_str("Möchten Sie das Spiel beenden oder ein neues Spiel starten? " + "Drücken Sie 'q' zum Beenden oder 'r', " "um ein neues Spiel zu starten...", [])