Exemplo n.º 1
0
        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));
                }

            }
        }
Exemplo n.º 2
0
        public Puissance4()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            damier = new Plateau();
            positionjaune = 3;
            touche_up = true;
            etat = 0;

            ordi = new IA(damier);
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
 public IA(Plateau damier)
 {
     rnd = new Random();
     this.niveau = 1;
     this.damier = damier;
 }