This is what the code for update pv looks like in search():
Code: Select all
/* update the pv: */
pv[ply][ply] = moves[i];
for (j = ply+1; j < pv_length[ply+1]; j++)
pv[ply][j] = pv[ply+1][j];
pv_length[ply] = pv_length[ply+1];
The regular make in search is:
Code: Select all
make (&moves[0], i);
Code: Select all
// WB command loop:
while(1) {
if(stm == computer) {
Search();
abort = 0;
bestMove = PV[0]; **in my case "bestMove"is: comp_move = think();
ponderMove = PV[1]; **haven't found a way other than flip the board
MakeMove(bestMove); ** in my case: make (&comp_move, 0)
if I change the 0 to 1, it flips the board.
PrintMove(bestMove);
}
if(ponderOn) {
if(ponderMove) {
MakeMove(ponderMove);**Ive tried making new variables, none work
so far. They all just cause the board to flip
and the engine has no idea about the first PV move.
Search();
UnMake();
} else Search();
}
abort = 0;
ReadLine(inbuf);
// execute command
....
}
Code: Select all
moves[i] = pvmove[i] (or maybe pvmove[ply]???)
In my code: (not working! this is just an example of a recent experiment)
Code: Select all
if ((allow_pondering && !force_mode && !result && game_ply != 0)
|| is_analyzing)
{
*** ponder_move = pv[0][0]; ***
is_pondering = TRUE;
make (&ponder_move, 0);
think();
unmake (&ponder_move, 0);
is_pondering = FALSE;