コード例 #1
0
ファイル: Test.cs プロジェクト: RudyMeijer/Chess
        private void TestDefaultBord()
        {
            bord     = new Bord();
            computer = new Computer(bord, 5);
            zet      = computer.BedenkBesteZet(Kleur.WIT);
            Debug.Assert(zet.ToString() == "b3", "zet ");             // V103 Elapsed time: 156 ms
            Debug.Assert(computer.bestEval == 1, "besteval ");
            //Debug.Assert(computer.count == 28329, "count "); // Elapsed time: 1078 ms
            //Debug.Assert(computer.count == 27979, "count "); // V104
            Debug.Assert(computer.count == 27966, "count ");             // V105++
            computer.maxPly = 6;
            // V102 Elapsed time: 18734 ms
            // V103 Elapsed time: 1562 ms (Remove EvalueerAbsoluut)
            // V103 Beste zet: a3 eval: -1, count: 546771, Elapsed time: 1781 ms
            // V104 Beste zet: a3 eval: -1, count: 518719, Elapsed time: 1703 ms
            // V105 Beste zet: a3 eval: -1, count: 518719, Elapsed time: 1937 ms
            // V105 Beste zet: a3 eval: -1, count: 518719, Elapsed time: 1359 ms zonder Check() function

            //while(true)
            zet = computer.BedenkBesteZet(Kleur.WIT);
            Debug.Assert(zet.ToString() == "a3", "zet ");
            Debug.Assert(computer.bestEval == -1, "besteval <> -1");
            //Debug.Assert(computer.count == 546780, "count <>");
            //Debug.Assert(computer.count == 546771, "count <>"); // V103
            //Debug.Assert(computer.count == 518719, "count <>"); // V104
            Debug.Assert(computer.count == 483676, "count <>");             // V105++
        }
コード例 #2
0
 private void Display(Bord bord)
 {
     Clear(bord);
     for (int x = 0; x < 8; x++)
     {
         for (int y = 0; y < 8; y++)
         {
             if (Bord.veld[x, y] != 0)
             {
                 DisplayStuk(Bord.getStuk(x, y), x, y);
                 Application.DoEvents();
             }
         }
     }
 }
コード例 #3
0
 private void InitializeSchaakbord() //V118
 {
     aanZet   = Kleur.WIT;
     bord     = new Bord();
     clock    = new Clock(btnHint);
     notation = new Notation(listView1);
     computer = new Computer(bord, 5);
     if (speler != null)
     {
         speler.Dispose();               //V122
     }
     speler             = new Speler(this.shapeContainer1, computer);
     speler.animate     = animationToolStripMenuItem.Checked; //V146
     speler.Speler_Zet += new ZetEventHandler(Speler_Zet);
     Display(bord);
 }
コード例 #4
0
        private void Clear(Bord bord)
        {
            OvalShape shape;

            for (int x = 0; x < 8; x++)
            {
                for (int y = 0; y < 8; y++)                                     //if (Bord.veld[x, y] != 0)
                {
                    shape = speler.getShape(new Veld(x, y));
                    if (shape != null)
                    {
                        speler.doos.BergOp(shape);
                    }
                }
            }
        }
コード例 #5
0
        internal string Save()
        {
            StringBuilder result = new StringBuilder();

            for (int y = 0; y < 8; y++)
            {
                result.AppendFormat("{0}:", 8 - y);
                for (int x = 0; x < 8; x++)
                {
                    result.AppendFormat("{0,2}", Bord.getStuk(x, y));                    //veld[x, y]);
                }
                result.AppendLine(";");
            }
            result.AppendLine("   a b c d e f g h");
            return(result.ToString());
        }
コード例 #6
0
ファイル: Test.cs プロジェクト: RudyMeijer/Chess
        public Test()
        {
            bord     = new Bord();
            computer = new Computer(bord, 1);
            bool loop = false;// System.Diagnostics.Debugger.IsAttached;

            do
            {
                //TestDefaultBord();
                //TestPromotion();
                //TestPionzet();
                //TestAlphaBeta();
                //TestDameZet();
                //TestMat();
                //TestMat1();
                //TestMatToren();
                //TestMat3();
                TestMatInZes();
                //TestCastling();
            } while (loop);
        }
コード例 #7
0
ファイル: Computer.cs プロジェクト: RudyMeijer/Chess
 public Computer(Bord bord, int maxPly)
 {
     this.bord   = bord;
     this.maxPly = maxPly;
 }
コード例 #8
0
 public Veld(int x, int y)
 {
     this.x    = x;
     this.y    = y;
     this.stuk = Bord.getStuk(x, y);
 }