bug-gnubg
[Top][All Lists]
Advanced

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

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


From: Jon Kinsey
Subject: Re: [Bug-gnubg] Resignation wrongly accepted by gnubg
Date: Wed, 24 Nov 2004 09:14:54 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041103 Thunderbird/0.9 Mnenhy/0.6.0.104

Petr Kadlec wrote:
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?

That's roughly what I was thinking, the simplest fix is to just swap the sign or rEqAfter for the dice rolled case. I'm not sure your code is quite right though as surely who's roll it is effect's the equities?

I'll check in the simple fix - as it will definitely be better...

Jon

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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