Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redemarre partie victoire/defaite #37

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading