From 618039a0e7f8a723e352000a9f40f5c126947faf Mon Sep 17 00:00:00 2001 From: mouheb182 Date: Tue, 26 Nov 2024 16:55:55 +0100 Subject: [PATCH 1/2] docs: Authors modification --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 33b4e9c..0cae2f0 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -23,4 +23,4 @@ - Sarra, NEBLI, sarranebli99@gmail.com - Sabrina, HASSAIM, hassaimsabrina@gmail.com - Maily, CIAVALDINI, mailyciavaldini@gmail.com - +- Mouheb, Felli, mouhebfelli@gmail.com From 339f331668cd6c1df1647aa19896e2d8a243fa5c Mon Sep 17 00:00:00 2001 From: mouheb182 Date: Tue, 26 Nov 2024 16:57:14 +0100 Subject: [PATCH 2/2] fix: Mouvement counter bug fix --- src/demineur.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/demineur.py b/src/demineur.py index 6e93124..bb8b33b 100644 --- a/src/demineur.py +++ b/src/demineur.py @@ -6,7 +6,7 @@ from statistiques import Statistiques def choisir_difficulte(): - """Demande à l'utilisateur de choisir un niveau de difficulté + """Demande à l'utilisateur de choisir un niveau de difficulté et retourne les paramètres du jeu.""" niveau_difficulte = input( "Choisissez un niveau de difficulté (facile, moyen, difficile, custom) : " @@ -55,7 +55,7 @@ class Demineur: def __init__(self, fichier_sauvegarde='demineur.json', taille=10, nombre_mines=20, exploratoire=False): - """ + """ Initialize the game with a grid and place mines based on parameters. :param fichier_sauvegarde: Save file name. :param taille: Grid size. @@ -106,7 +106,6 @@ def decouvrir_cases(self, x, y): if self.grille_visible[y][x] != '■': return self.grille_visible[y][x] = self.grille[y][x] - self.mouvements += 1 if self.grille[y][x] == '0': self.decouvrir_cases(x - 1, y) @@ -245,6 +244,7 @@ def jouer(self): break self.decouvrir_cases(x, y) + self.mouvements += 1 if sum(row.count('■') for row in self.grille_visible) == self.nombre_mines: print("Gagne !") game_in_progress = False