import java.awt.*; import java.util.Random; public class FenetreRndmGrille extends Fenetre{ public static final int RANDOM=1; private int taille; private int ValeurEntre; private int ValeurSortie; private int[] tabCouleur; private boolean[][] grille; private Cellules[][] grilleCellules; private Modifications modif; public FenetreRndmGrille(int taille){ super(); this.taille = taille; this.grille = new boolean[this.taille][this.taille]; this.grilleCellules = new Cellules[this.taille][this.taille]; this.tabCouleur = new int[] {1, 1}; } public void randomGrille(){ this.fenetre.setSize(600, 600); this.fenetre.setLocation(450, 200); GridLayout gestionnaire = new GridLayout(this.taille,this.taille); this.fenetre.setLayout(gestionnaire); PanneauModification interfacePanel = new PanneauModification(this.grille, this.taille, this.grilleCellules, this.fenetre); interfacePanel.SetUp(); /* ======= Valeurs aléatoire pour l'entre et la sortie ========== */ Random rand = new Random(); ValeurEntre = rand.nextInt(this.taille*this.taille); ValeurSortie = rand.nextInt(this.taille*this.taille); if(ValeurEntre == ValeurSortie){ while(ValeurEntre == ValeurSortie){ ValeurSortie = rand.nextInt(this.taille*this.taille); } } int compteur=0; for(int i=0; i