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: Jacques_Ruiz
Subject: Re: Bug in Evaluate(), wrong arguments in call to LoneKing()
Date: Tue, 25 Feb 2003 12:49:31 +0100

That's right, there's no bug. My mistake.
----- Original Message -----
Sent: Tuesday, February 25, 2003 11:37 AM
Subject: Re: Bug in Evaluate(), wrong arguments in call to LoneKing()

-----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]