tournament works.. but things are not in the right place

This commit is contained in:
2025-02-05 15:20:11 +01:00
parent 04aa65f2a8
commit 425c5c716b
3 changed files with 59 additions and 48 deletions

View File

@@ -32,3 +32,26 @@ class View:
else:
print("Mauvais format d'ine")
def input_scores(self, match_list):
for match in match_list:
print(match)
print("Scores pour match", match_list.index(match) + 1, " :")
while True:
try:
result = input(f"1.{match.player1}, 2.{match.player2}, 3.Nul\n")
if result in ("1", "2", "3"):
if result == "1":
match.player1.score += 1
elif result == "2":
match.player2.score += 1
elif result == "3":
match.player1.score += 0.5
match.player2.score += 0.5
break
else:
print("Entrez un chiffre entre 1 et 3")
except ValueError:
print("Veuillez entrer un chiffre")