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++ }
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(); } } } }
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); }
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); } } } }
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()); }
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); }
public Computer(Bord bord, int maxPly) { this.bord = bord; this.maxPly = maxPly; }
public Veld(int x, int y) { this.x = x; this.y = y; this.stuk = Bord.getStuk(x, y); }