Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: I don't use illegal moves EVER

Author: leonid

Date: 08:06:52 11/25/99

Go up one level in this thread


On November 25, 1999 at 06:51:08, Daniel Clausen wrote:

>Hi
>
>On November 24, 1999 at 21:30:03, Robert Hyatt wrote:
>>
>>However, if you reach ply X and the side on move _is_ in check, then most of
>>the moves are going to be illegal.  It turns out to be useful to cull the
>>illegal moves more quickly than making the move and then discovering that it
>>is illegal.  With bitmaps, it is pretty efficient to generate legal moves
>>only, when you know you are in check to start with...
>
>I'm currently working on an inCheck-MoveGenerator. Most of the moves it
>generates are legal, but still not all. Consider the following: your king
>is checked by an enemy rook on the other side of the board. So I generate
>moves which:
>
>  -capture the enemy rook
>  -put a piece between the enemy rook and your king
>  -move king out of check
>
>But it's still possible that the piece you moved between the enemy rook
>and your king is pinned too, and therefore the move is illegal. Doesn't
>happen often, but it does.


In my logic, that probably is very close to your, legality of all the moves
found in such a way that it is all the time known who stays behind the piece
that work as shelter. So no extra surprises are possible.

With the care must be manipulated only the pieces that work as shelter for the
king. And once you know from what kind of fire your piece protect the king, all
the rest is simple and consume little time. If your king is under more that one
fire only his moves you can try to find.

Leonid.




>
>So my engine can detect most of the 1-legal-move-only positions and
>extend, but not all. For the moment I don't consider this a serious
>problem, since my engine has a lot of other problems. :)
>
>Kind regards,
> -sargon
>
>PS. Concerning NPS: With a special inCheck-MoveGenerator the NPS should
>    drop, although the programs performance overall increases. If you
>    use a lot of inCheck-extensions the NPS-drop is even bigger, because
>    the extensions LEAD to positions where you are in check and therefore
>    most moves are illegal.



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.