Computer Chess Club Archives


Search

Terms

Messages

Subject: perft(2) -> 420

Author: Stuart Cracraft

Date: 13:48:10 02/22/06


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.

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.