public void faireCopie(Plateau damierTest) { for (int i = 0; i < VX; i++) { for (int j = 0; j < VY; j++) { damierTest.setCase(i, j, this.getCase(i, j)); } } }
public Puissance4() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; damier = new Plateau(); positionjaune = 3; touche_up = true; etat = 0; ordi = new IA(damier); }
public int trouveColonne(bool joueur) { Plateau damierTest = new Plateau(); damier.faireCopie(damierTest); // copie damier dans damierTest for (int colonne = 0; colonne < damierTest.getVY(); colonne++) { if(damierTest.jouer(colonne, joueur) == 2){ return colonne; } damier.faireCopie(damierTest); } return -1; }
public IA(Plateau damier) { rnd = new Random(); this.niveau = 1; this.damier = damier; }