Author: Alvaro Jose Povoa Cardoso
Date: 08:09:04 07/28/02
Could someone (namely Dr. Hyatt) please explain to me what the code bellow does?
(the code that I surrounded with asteriscs)
In my program a draw score is simply zero.
It seems this is not the case for crafty.
How does crafty work with draw scores and why a non zero draw score is better?
Best regards,
Alvaro Cardoso
the following code is located at search.c
----------------------------------------------------------
| |
| now it's time to try a probe into the endgame table- |
| base files. this is done if we notice that there are |
| 5 or fewer pieces left on the board. EGTB_use tells |
| us how many pieces to probe on. note that this can be |
| zero when trying to swindle the opponent, so that no |
| probes are done since we know it is a draw. |
| |
----------------------------------------------------------
*/
if (ply<=iteration_depth && TotalPieces<=EGTB_use &&
WhiteCastle(ply)+BlackCastle(ply)==0 &&
(CaptureOrPromote(tree->current_move[ply-1]) || ply<3)) {
int egtb_value;
tree->egtb_probes++;
if (EGTBProbe(tree, ply, wtm, &egtb_value)) {
tree->egtb_probes_successful++;
alpha=egtb_value;
if (abs(alpha) > MATE-300) alpha+=(alpha > 0) ? -ply+1 : ply;
*********************************
* else if (alpha == 0) { *
* alpha=DrawScore(wtm); *
* if (Material > 0) { *
* alpha+=(wtm) ? 1 : -1; * -> what does this code do and why a
* } * draw score of non zero does a better job?
* else if (Material < 0) { *
* alpha-=(wtm) ? 1 : -1; *
* } *
* } *
*********************************
if(alpha < beta) SavePV(tree,ply,alpha,2);
tree->pv[ply].pathl=0;
HashStore(tree,ply,32000,wtm,EXACT,alpha,mate_threat);
return(alpha);
}
}
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.