Computer Chess Club Archives


Search

Terms

Messages

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

Author: leonid

Date: 17:58:09 11/25/99

Go up one level in this thread


On November 25, 1999 at 15:06:09, Daniel Clausen wrote:

>Hi
>
>On November 25, 1999 at 08:42:29, leonid wrote:
>>
>>I am curious about your InCheck-MovesGenerator. Do you use it for producing all
>>the moves beside the moves of the King? And if you do so, how you start your
>>procedure that recognize the legality of the moves? Do you make this by finding
>>at the beginning of given ply position of the King? And do you make work this
>>generator before even finding one single move? I am asking this to recognize my
>>part of the logic that correspond to your generator.
>
>The inCheck-MoveGenerator will (once I have time to finish it..) produce all
>legal
>moves, so yes, it also produces king moves. The logic is approx as follows:
>
>if(inCheck(sideToMove))
>{
>   if(numberOfAttackers>1)
>   {
>      // Produce only king evasion moves.
>   }
>   else
>   {
>      // 1. Produce king evasion moves.
>      // 2. Produce moves which capture moves which capture the
>      //     attacker.
>      // 3. If the attacker is not a knight, produce also moves where the
>      //     target square is between king and attacker. (and adding Mr Hyatts
>      //     pinning-check)
>   }
>}
>else
>{
>   // Call normal move-generator.
>}
>
>I hope I didn't forget something, but I can't check the code atm.
>Btw: Sorry for the bad formatting of my last 2-3 postings - I just
>switched to a new browser. :)
>
>Kind regards,
> -sargon

Very interesting since I found that your procedure very resemble to mine. I am
only lost something because of our different wording. If you would like to know
in what way I verify my moves legality, you can ask about this. Will try to
explain in the best way that I can.

I have for you one question: Do you put in your moves sequence the moves that
will check the ennemy king at the head of the line or not? And especially in he
ply one?

Regards,
Leonid.





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.