Author: Robert Hyatt
Date: 14:33:17 02/22/06
Go up one level in this thread
On February 22, 2006 at 16:48:10, Stuart Cracraft wrote:
>Pardon my blindness but I've been doing this too long.
>
>I wrote a quick perft which is buggy.
>
>It gives 20 for perft(1) but 420 for perft(2) - should be 400.
Question is, what are you counting?
Normally perft just counts leaf positions.. Sounds like you are counting all,
because your number is 420. there are 400 leaf positions, but then there are
another 20 interior (ply-1 positions) giving a total of 420.
>
>It is:
>
>void perft(int *bd,int depth)
>{
> int mvi;
> mv ml[MAXMOVES];
> if (depth<=0) return;
> genmv(bd,ml,stm,NOSORT,SEENOTOK);
> mvi = 0;
> while (ml[mvi].from != -1) {
> makemv(bd,ml[mvi]);
> if (!incheckopp(bd)) {
> totalnodes++;
> perft(bd,depth-1);
> }
> unmakemv(bd);
> mvi++;
> }
>}
>
>The call is
>
>totalnodes = 0L;
>perft(bd,maxdepth);
>printf("nodes visited = %ld\n",totalnodes);
>
>Apart from the obvious that there could be a bug in my genmv(),
>is there anything about the above that would produce 420 instead
>of 400 for perft(2)?
>
>Thanks,
>
>Stuart
>
>P.S. I am working sick (and coding sick) for about 19 days now (flu,
>pneumonia, bronchitis) and am not seeing very obvious things which I
>would hope this is.
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.