[Top][All Lists]

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

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

From: Joseph Heled
Subject: Re: [Bug-gnubg] Resignation wrongly accepted by gnubg
Date: Wed, 24 Nov 2004 22:26:59 +1300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616

The real correct way - after the dice shake - is to perform the move (you can either be charitable and pick the best move, or non and pick the worst move), and check the situation then ...


Jon Kinsey wrote:
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...



Bug-gnubg mailing list

reply via email to

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