diff --git a/ChoixAlgo.java b/ChoixAlgo.java new file mode 100644 index 0000000..036eab9 --- /dev/null +++ b/ChoixAlgo.java @@ -0,0 +1,7 @@ +public class ChoixAlgo extends Fenetre { + public ChoixAlgo(boolean[][] uneGrille){ + super(); + outils.PrintGrilleBool(uneGrille, uneGrille.length); + } + +} diff --git a/FenetreImpGrille.java b/FenetreImpGrille.java index 18cff12..5d9766b 100644 --- a/FenetreImpGrille.java +++ b/FenetreImpGrille.java @@ -1,11 +1,6 @@ import java.awt.*; public class FenetreImpGrille extends Fenetre { - public static final int COULOIR=0; - public static final int MUR=1; - public static final int ENTREE=2; - public static final int SORTIE=3; - private boolean[][] grille; public FenetreImpGrille(){ @@ -46,21 +41,21 @@ public class FenetreImpGrille extends Fenetre { } if((i*taille+j)==(Lentre*taille+Centre)){ - Cellules cellules = new Cellules(i, j, ENTREE); + Cellules cellules = new Cellules(i, j, Cellules.ENTREE); this.fenetre.add(cellules); } else if((i*taille+j)==(Lortie*taille+Cortie)){ - Cellules cellules = new Cellules(i, j, SORTIE); + Cellules cellules = new Cellules(i, j, Cellules.SORTIE); this.fenetre.add(cellules); } else if(ce_double_tab[i][j] == 1){ - Cellules cellules = new Cellules(i, j, MUR); + Cellules cellules = new Cellules(i, j, Cellules.MUR); this.fenetre.add(cellules); } else{ - Cellules cellules = new Cellules(i, j, COULOIR); + Cellules cellules = new Cellules(i, j, Cellules.COULOIR); this.fenetre.add(cellules); } } } this.fenetre.setVisible(true); - + outils.PrintGrilleBool(this.grille, taille); } } diff --git a/FenetreRndmGrille.java b/FenetreRndmGrille.java index de6a9b1..5eeefa9 100644 --- a/FenetreRndmGrille.java +++ b/FenetreRndmGrille.java @@ -52,9 +52,9 @@ public class FenetreRndmGrille extends Fenetre{ int nombreAleatoire = rand.nextInt(2); // génère un nombre entre 0 et 2 if(nombreAleatoire == 0){ - grille[i][j] = false; - } else { grille[i][j] = true; + } else { + grille[i][j] = false; } this.modif = new Modifications(interfacePanel, grille,this.tabCouleur); @@ -94,6 +94,8 @@ public class FenetreRndmGrille extends Fenetre{ compteur++; } } + outils.PrintGrilleBool(grille, taille); + this.fenetre.setVisible(true); } } diff --git a/GestionExporter.java b/GestionExporter.java index 6ca3b52..c753458 100644 --- a/GestionExporter.java +++ b/GestionExporter.java @@ -31,12 +31,13 @@ public class GestionExporter implements ActionListener{ this.framePopup.dispose(); //outils.PrintGrilleBool(this.cetteGrille, this.cetteTaille); PreEcriture precriture = new PreEcriture(this.cetteGrille, this.grilleCellules, this.cetteTaille); + ChoixAlgo suite = new ChoixAlgo(this.cetteGrille); } else if (cet_event.equals(this.Reponses2)){ this.frameGrille.dispose(); this.frameModif.dispose(); this.framePopup.dispose(); - System.out.println("tout a été fermé"); + ChoixAlgo suite = new ChoixAlgo(this.cetteGrille); } } } \ No newline at end of file diff --git a/Lecture.java b/Lecture.java index 7393c74..983c098 100644 --- a/Lecture.java +++ b/Lecture.java @@ -106,7 +106,7 @@ public class Lecture { } for(int i=0; i