Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
Nettoyage du code
Browse files Browse the repository at this point in the history
- Aération du code
- Séparation d'un ternaire dans une autre variable, afin de raccourcir une ligne de code trop longue
  • Loading branch information
belicfr committed Feb 7, 2024
1 parent ac48b57 commit bf38645
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/engine/joueur.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ def choisir_colonne(self, grille: Grille)->int:
"""
if self.est_humain:
colonne = input(f"Joueur {self.pseudo} choisissez une colonne : ")

while not colonne.isdigit():
print("Erreur : Veillez saisir un entier")
colonne = input(f"Joueur {self.pseudo} choisissez une colonne : ")

colonne = int(colonne)
else:
colonne = min_max(grille, 4, self.jeton, Rond() if self.jeton == Croix() else Croix(), self.jeton)[0]
nouveau_jeton = Rond() if self.jeton == Croix() else Croix()
colonne = min_max(grille, 4, self.jeton, nouveau_jeton, self.jeton)[0]

return colonne

def __str__(self):
Expand Down

0 comments on commit bf38645

Please sign in to comment.