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

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

Re: Bug in Evaluate(), wrong arguments in call to LoneKing()


From: Simon Waters
Subject: Re: Bug in Evaluate(), wrong arguments in call to LoneKing()
Date: Tue, 25 Feb 2003 10:37:08 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jacques_Ruiz wrote:
> Hello.
> I've spotted a bug in Evaluate(), file eval.c. A call with wrong
> arguments is made to LoneKing(), passing the same side as both the
> winner and the looser.
>
> source:
>    //*  One side has a lone king and other side has no pawns *//
>    *if* (board.material[xside] == 0 && board.b[side][pawn] ==
NULLBITBOARD)
>       *return* LoneKing (side, xside);
>    *if* (board.material[side] == 0 && board.b[xside][pawn] ==
NULLBITBOARD)
>       *return* LoneKing (side, side);  /* BUG HERE */
>
> correct version:
>    //*  One side has a lone king and other side has no pawns *//
>    *if* (board.material[xside] == 0 && board.b[side][pawn] ==
NULLBITBOARD)
>       *return* LoneKing (side, xside);
>    *if* (board.material[side] == 0 && board.b[xside][pawn] ==
NULLBITBOARD)
>       *return* LoneKing (xside, side);  /* FIXED */

The arguments to LoneKing appear to me to be;

1) Side to move
2) Loser

The called routines, LoneKing and the King Bishop and Knight
mating routine all assume the winner (or winer <sic>) is the
opposite of the loser (1^Loser).

If you still think it is wrong can you submit a position the
modified version wins at that the original doesn't, or more
explanation.

 Thanks for your interest, bugs are in there somewhere.

 Simon



-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+W0dSGFXfHI9FVgYRAmPTAJ9bHsRoi5j21xUxoPwon+6nnA4TvACdGgYi
PP7y6Bvu4BTnfCxcbIPRL28=
=oJMW
-----END PGP SIGNATURE-----




reply via email to

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