[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] Resignation wrongly accepted by gnubg

From: Petr Kadlec
Subject: Re: [Bug-gnubg] Resignation wrongly accepted by gnubg
Date: Tue, 23 Nov 2004 21:55:23 +0100
User-agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)

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?

Petr Kadlec <address@hidden>
ICQ #68196926, http://mormegil.wz.cz/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]