Hi all!
Very small improvement:
don't try verify the "checks" after null move pruning (first ply).
It is unnecessary, because the opponent had to leave the check.
-Tamás
Small improvement
Moderators: hgm, Dann Corbit, Harvey Williamson
Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Re: Small improvement
Not sure whether I understand correctly... but when one side leaves check, this can generate check for the other side, isn't that an issue?
Re: Small improvement
After null move, the check verify is unnecessary.
If you predefine the outcome of a move, the code is even simpler.
Code: Select all
if (nullOK)
{
TakeNullMove(); // eg: replace side
Score = -AlphaBeta(-beta, -beta+1, depth-4, false, true);
// This call: AlphaBeta -> next node for opponent
// No need to verify again the check at next node
TakeBackNull(); // eg: replace side
if (Score >= beta) {
return Score;
}
}
Code: Select all
function AlphaBeta(alpha, beta, depth, nullMove, afterNullMove) {
......
if (afterNullMove == false) { // Unnecessary after null move (at first node)
inCheck = isCheck();
}
......
}
Re: Small improvement
You can do even better if you test for alignment of the origin (Queen-alignment) and destination (Superpiece or Amazon alignment). If neither matches, the move cannot be a checking move.