Fix padding calculation

This commit is contained in:
2022-08-19 08:14:19 +02:00
parent 34004a0099
commit 2db496c4d7

View File

@@ -59,7 +59,12 @@ def print_standings(players, guesses, results):
else: else:
text = f"??? / {guesses[player][num_round - 1]} (?)" text = f"??? / {guesses[player][num_round - 1]} (?)"
pad = " " * (width - len(text) - 2) # Remove invisivle characters for padding calculation
clean = text
for color in COLORS.values():
clean = clean.replace(color, '')
pad = " " * (width - len(clean) - 2)
print(f" {pad}{text} |", end="") print(f" {pad}{text} |", end="")
print() print()