Jon Kinsey napsal(a):
After a closer look, things are clearer. If the dice haven't been
shaken, the position is evaluated (from the current players
perspective). If the dice have been shaken the best (0-ply) move is
made and then the position evaluated (from the other players
perspective).
Hmm, I see, so I guess the evaluation code should be rather something
like this (play.c, somewhere around line 1034):
if (ms.anDice[0] > 0) {
/* Opponent has rolled the dice and then resigned. We
want to find out if the resignation is OK after the roll */
EvaluateRoll (arOutput, ms.anDice[0], ms.anDice[1], ms.anBoard, &ci,
&ecResign );
} else {
/* Opponent did not roll the dice, consider the position from our
view */
int anBoardTemp[ 2 ][ 25 ];
memcpy( &anBoardTemp[ 0 ][ 0 ], &ms.anBoard[ 0 ][ 0 ], 2 * 25 *
sizeof( int ) );
SwapSides( anBoardTemp );
GeneralEvaluationE( arOutput, anBoardTemp, &ci, &ecResign ) ;
}
and the condition should be inverted:
if( ( rEqAfter + epsilon ) >= rEqBefore )
(Or, do it the other way around, but this seems more logical to me.
Maybe the SwapSides etc. is not necessary and just inverting arOutput
would suffice, I don't know.)
What do you think about that?