bug-gnu-chess
[Top][All Lists]
Advanced

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

Re: gnuchess question/bug?


From: Simon Waters
Subject: Re: gnuchess question/bug?
Date: Mon, 18 Jan 2010 18:16:46 +0000
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706)

Lars Mathiesen wrote:
> 
> I am hoping that you are the right one to ask.
>  
> In eval.c (version 5.07) in ScoreK I have noticed the following code:
>  
>       b = (board.b[white][pawn] | board.b[black][pawn]);
>       while (b)
>       {
>          sq1 = leadz (b);
>          CLEARBIT (b, sq1);
>          if (BitPosArray[sq1] & board.b[white][pawn])
>             s -= distance[sq][sq1+8] * 10 - 5;
>          else if (BitPosArray[sq1] & board.b[white][pawn])
>             s -= distance[sq][sq1-8] * 10 - 5;
>          else
>             s -= distance[sq][sq1] - 5;
>       }
> Clearly the "else if" is wrong. Since it can never happen.
> And also this piece of code scores differently for white and black which
> should not happen!
> ... SNIP ...

Hi Lars,

fairly sure you are right in both statements.

I assume one of these (the second?) should have said black instead of
white for reasons of symmetry, and the test is probably too crude to be
useful (even if it were right).

I will test the performance of removing it entirely, versus correcting
it, and include the better outcome in 5.08. It may be worth including
some measure of king distance from pawns.

 Simon




reply via email to

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