Author: Michel Langeveld
Date: 04:54:25 01/11/04
Go up one level in this thread
On January 11, 2004 at 04:33:58, Michel Langeveld wrote:
>If perft 4 is wrong ...
>
>then I always calculate perft 4 again but change
>my program to print all perft 3 results of this position. Then take
>crafty and check all this perft 3 values. Then you know what move went wrong and
>go futher with this method.
So as follows:
I had a problem with Gothic Chess start position with perft 3 after chaning my
attack functions drastically. My new and old version differ in perft 3. Then
made a change in perft() to print perft during calculating 3 with all subresults
of perft 2.
tscp> perft 3
00756 a2a3
00812 a2a4
00812 b2b3
00813 b2b4
00840 c2c3
00869 c2c4
00949 d2d3
01006 d2d4
01005 e2e3
01034 e2e4
00893 f2f3
00950 f2f4
01006 g2g3
01007 g2g4
00784 h2h3
00841 h2h4
00840 i2i3
00841 i2i4
00756 j2j3
00812 j2j4
00784 b1a3
00840 b1c3
01228 e1d3
01199 e1f3
01031 g1f3
00979 g1h3
00812 i1h3
00784 i1j3
total perft = 25283
tscp>
Then I take my old executable and start as follows:
tscp> a2a3
tscp> perft 2
total perft = 756
tscp> back
tscp> undo
tscp> a2a4
tscp> perft 2
total perft = 812
tscp> undo
tscp> b2b3
tscp> perft 2
total perft = 812
tscp> undo
tscp> b2b4
tscp> perft 2
total perft = 813
tscp> undo
tscp> c2c3
tscp> perft 2
total perft = 840
tscp> undo
tscp> c2c4
tscp> perft 2
total perft = 869
tscp> undo
tscp> d2d3
tscp> perft 2
total perft = 949
tscp> undo
tscp> d2d4
tscp> perft 2
total perft = 1006
tscp> undo
tscp> e2e3
tscp> perft 2
total perft = 1085
e2e3 is different so I go futher debugging this
This is the code ... have fun!
long perft(int depth, int output)
{
int i, number = 0, legal = 0;
if (depth == 0)
{
return 1;
}
gen();
/* loop through the moves */
for (i = first_move[ply]; i < first_move[ply + 1]; ++i)
{
if (!makemove(gen_dat[i].m.b)) continue;
number += perft(depth-1, output);
takeback();
}
if (hply == 1)
{
printf("%05d ", number);
print_his_long();
}
return number;
}
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.