Skip to content

Commit

Permalink
Redemarre partie victoire/defaite (#37)
Browse files Browse the repository at this point in the history
* CHORE: Update authors

* FIX: Victory or defeat

---------

Co-authored-by: SMoraisDev <[email protected]>
  • Loading branch information
Sebb955 and SMoraisDev authored Oct 16, 2024
1 parent efd40c1 commit 7fb50a9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
- Marwane, RACHAD, [email protected]
- Mathis, Beauville, [email protected]
- Alexandre ANTUNES MENDES, [email protected]
- Jimmy, Levacher, [email protected]
- Jimmy, Levacher, [email protected]
- Sebastien, LAFRIZI, [email protected]
12 changes: 12 additions & 0 deletions src/demineur.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@ def jouer(self):
self.statistiques.display_statistics()


# Demande si le joueur souhaite recommencer une partie
while True:
restart = input("Voulez-vous recommencer une partie ? (oui/non) : ").lower()
if restart == 'oui':
nouveau_jeu = Demineur(self.nombre_mines)
nouveau_jeu.jouer()
break
if restart == 'non':
print("Partie terminée !")
break
print("Réponse invalide, veuillez répondre par 'oui' ou 'non'.")

if __name__ == "__main__":
niveau_difficulte = input("Choisissez un niveau de difficulte (facile, moyen, difficile): ")
try:
Expand Down

0 comments on commit 7fb50a9

Please sign in to comment.