Computer Chess Club Archives


Search

Terms

Messages

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

Author: leonid

Date: 18:47:03 11/24/99

Go up one level in this thread


On November 24, 1999 at 21:30:03, Robert Hyatt wrote:

>On November 24, 1999 at 19:32:04, leonid wrote:
>
>>On November 24, 1999 at 18:19:01, Robert Hyatt wrote:
>>
>>>On November 24, 1999 at 09:47:30, blass uri wrote:
>>>
>>>>On November 24, 1999 at 08:30:06, Jari Huikari wrote:
>>>>
>>>>>On November 22, 1999 at 19:05:13, leonid wrote:
>>>>>
>>>>>>Was puzzled few times by finding that many logics use illegal moves and
>>>>>>succesfully. Until now I used this kind of moves only in the ply zero. Expect to
>>>>>>rewrite my logic completelly with usage of illegal moves in every ply.
>>>>>
>>>>>This doesn't answer to your questions, but I decided to mention it anyway.
>>>>>Am I alone or does someone else also generate only legal moves?
>>>>>
>>>>>					Jari
>>>>
>>>>I remember karinsdad said that he decided to generate only legal moves because
>>>>he cannot use ideas like the single reply extension if he generate illegal
>>>>moves.
>>>
>>>That isn't necessary.  I don't generate legal moves _unless_ I am in check
>>>at the beginning of a ply.  This lets me find the 1-legal-move positions, with-
>>>out having to test for legality in 99% of the positions...
>>
>>Very interesting but not clear for me. Expression "at the beginning of the ply"
>>mix me up. If king is under the fire in given position, you should find the
>>moves for that ply where king is under the fire. All the moves that will be
>>found for this ply are the same in this sense. Maybe I am missing here
>>something, but what exactly?
>>
>>Leonid.
>
>
>Here's the idea:  If you reach ply X, and the side on move is _not_ in
>check, then _most_ of the moves are going to be legal.  The only ones that
>won't be legal are the ones that move into check (not many king moves compared
>to all the other possible moves) and the ones that move a piece pinned on the
>king.
>
>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...
>
>And since you generate only legal moves when you start off in check at a ply,
>you can count the number of moves and extend if there is exactly one, for
>example...
>
>
>

Very good explanation! My guess in the message, that I already put on the Web,
was that you do your check recognition in some more rapid way that me, and now I
see why it can be this way. You use the bitmat that I never tryed. Pobably here
is all the explantion. For me the fact of recognition os the check is almost as
time consuming as legality of all the pieces beside the king.

Thanks you very much for your response!
Leonid.



>
>>
>>
>>
>>>
>>>
>>>
>>>
>>>>
>>>>I have another question.
>>>>Did people try to compare between the 2 options before deciding to generate
>>>>illegal moves and if the answer is positive what was the result of the
>>>>comparison.
>>>
>>>
>>>yes...  It is _far_ slower to make sure moves are legal _before_ you search
>>>them.  And if you never search them (as when a node fails high) then you waste
>>>all the computation time for nothing...
>>>
>>>
>>>
>>>
>>>>
>>>>Is the legal move generator slower in solving test positions(assuming no special
>>>>extensions like single reply extension) and how much slower?
>>>>
>>>>Uri
>>>
>>>
>>>at least a factor of 2 for me...  ie generating legal moves would be 1/2 the
>>>speed of not doing this...



This page took 0.01 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.