I will be implementing a PV extracted from the transposition table. The
code seems to work but I'm not sure if it is correct. I will be posting it
here hoping that someone would point out the bugs in it or someone could
teach me a better implementation.
- Code: Select all
void displaypv(int move, int w, int onmove, int depth){
int x=0, c=onmove;
static int pvt[MAXPLY];
if(xboard) printf("%d %d %d %d ", depth, w, (gettime()-t1)/10, (int)nodes);
else printf("%3d %9d %9d %6d %5d ",depth,(int)(nodes-qnodes),(int)qnodes,(gettime()-t1),w);
pvt[x]=move;
while(TRUE){
if(!domove(pvt[x++], c)){ pvt[--x]=0; break; };
if(checkhash(&pvt[x], &w, 0) == EXACT){ c^=1; continue; }
else{ pvt[x] = 0; break;}
}
while(x--){ undomove(c); c^=1;}
for(x=0; pvt[x]; x++) printf("%s ", displaymove(pvt[x]));
printf("\n");
fflush(stdout);
}
Thanks in advance.
Edsel