entering a node i apply the PV test...
Code: Select all
bool bIsPV = (alpha != beta - 1);
entering the move loop, the first move available is made, bumping the MoveCount variable from 0 to 1 and then we reach the PVS code. I coded the PVS code to what I "thought" was the correct way to do it, so....
Code: Select all
if (MoveCount == 1) { // haven't searched yes, so PV
v = -ABTTFH(&p1, -beta, -alpha, NewDepth, &cPV, NM::NM_ALLOWED);
}
else {
v = -ABTTFH(&p1, -alpha - 1, -alpha, NewDepth, &cPV, NM::NM_ALLOWED);
if ((v > alpha) && (v < beta))
v = -ABTTFH(&p1, -beta, -alpha, NewDepth, &cPV, NM::NM_ALLOWED);
}
Code: Select all
if (bIsPV) { // whether we are trying the first move or not...
v = -ABTTFH(&p1, -beta, -alpha, NewDepth, &cPV, NM::NM_ALLOWED);
}
else {
v = -ABTTFH(&p1, -alpha - 1, -alpha, NewDepth, &cPV, NM::NM_ALLOWED);
if ((v > alpha) && (v < beta))
v = -ABTTFH(&p1, -beta, -alpha, NewDepth, &cPV, NM::NM_ALLOWED);
}