fixed bug in clean_input.py for empty card selection.

print formatting in quartett.py
This commit is contained in:
Steinadler 2021-01-15 15:29:12 +01:00
parent ef57e98647
commit 6efc45ec2e
2 changed files with 8 additions and 3 deletions

View File

@ -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

View File

@ -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...", [])