Author: Christophe Theron
Date: 10:22:09 07/07/00
Go up one level in this thread
On July 07, 2000 at 12:25:10, KarinsDad wrote:
>Other than mine?
>
>One of the bugs having my program play itself on Winboad discovered was that the
>king would move out of check into a square that was not originally covered by
>check, but is now an illegal square due to the checking piece now attacking it.
>For example:
>
>[D]1Q4k1/6pp/8/8/8/8/8/6K1 b
>
>In this position, white just played Qb8+. Black then plays the illegal move Kh8
>since it determines which squares are not attacked by white using the
>PieceAttacks structure (which is just a set of bits indicating which squares are
>attacked by which piece in a given position).
>
>Now, I am adding code to avoid this problem, but without generating ALL moves
>ahead of time and checking for legality after illegal moves have been generated,
>does anyone else have a program which does this up front? And if so, is there a
>slick way of doing it (my method is kind of clumsy)?
>
>KarinsDad :)
I just REMOVE the king from the board before generating escapes from check.
And anyway I test any move for legality after doing it.
Christophe
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.