From eb04d8bb9f5a934099ada905bfa7cbe9d9202d81 Mon Sep 17 00:00:00 2001 From: doucoure Date: Wed, 1 Apr 2026 23:08:39 +0200 Subject: [PATCH] =?UTF-8?q?Le=20syst=C3=A8me=20de=20grille=20a=20=C3=A9t?= =?UTF-8?q?=C3=A9=20ajouterr,=20la=20prochaine=20=C3=A9tape=20est=20l'inte?= =?UTF-8?q?rface=20graphique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Case.java | 4 ++-- Grille.java | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++ Makefile | 7 ++++-- Menu.java | 2 ++ 4 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 Grille.java diff --git a/Case.java b/Case.java index 6905ac0..59f9d5c 100644 --- a/Case.java +++ b/Case.java @@ -2,14 +2,14 @@ public class Case { private boolean estMinee; private boolean estRevelee; - private int Marqueur; + private int marqueur; private int nbMinesautour; public Case() { this.estMinee = false; this.estRevelee = false; - this.Marqueur = 0; + this.marqueur = 0; this.nbMinesautour = 0; } diff --git a/Grille.java b/Grille.java new file mode 100644 index 0000000..b6be1e2 --- /dev/null +++ b/Grille.java @@ -0,0 +1,63 @@ +import java.util.Random; + +public class Grille { + + private Case[][] grille; + private int ligne,colonne; + private Random generateur = new Random(); + + public Grille(int ligne,int colonne) { + this.ligne = ligne; + this.colonne = colonne; + this.grille = new Case[ligne][colonne]; + for(int i =0;i= 0 && vL < ligne && vC >= 0 && vC < colonne){ + if (grille[vL][vC].getEstMinee()) { + compteur++; + } + + } + + + } + } + grille[l][c].setNbMinesautour(compteur); + } + + public void calculerToutesLesMines(){ + for(int i =0;i