Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: about in_check()

Author: Sune Fischer

Date: 17:02:49 06/16/03

Go up one level in this thread


On June 16, 2003 at 17:27:25, Bo Persson wrote:

>On June 15, 2003 at 10:15:31, Sune Fischer wrote:
>
>>
>>>I guess the programs that use this method, like Crafty, also have a special
>>>get_out_of_check() move generator. When in check the possible moves are very
>>>limited:
>>>
>>>- capture the checking piece (if it is only one)
>>>- put another piece between the king and the checker (if it is a slider)
>>>- move the king away from the attacked ray
>>>- now you are really desperate - try an en passant capture!
>>>
>>>Most of these will not move you into (another) check, so it will reduce the
>>>cost.
>>
>>Exactly.
>>
>>>>Secondly you need to know you are in check so you can _extend_.
>>>>
>>>
>>>or you can extend on moving out of check. You know you are there because you use
>>>the special get_out_of_check routine.  :-)
>>
>>You've lost me.
>>If you don't check for anyhing you don't know anything.
>
>Of course you have to check if the opponents move is checking your king. What
>you can avoid is checking if *your* move checks your *own* king. That will be
>revealed when it is immediately captured.
>

Ah ok got it now. :)

I don't do that myself, most of these cases are dealt with by the special check
evader, so that leaves only pins. And for those I do actually check if I moved
_into_ a check.

It doesn't seem as though I can speed up anything by checking for the king
capture later, it is still one check, doing it before just saves the generation
of the captures.

-S.



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.