Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: about in_check()

Author: Bo Persson

Date: 14:27:25 06/16/03

Go up one level in this thread


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.


>How it is possible to apply an extension even for the get_out_of_check?
>How will you know to call a get_out_of_check routine if you don't know you're in
>check?
>
>Suppose you are in check, you happen to search the capture of the checking piece
>first. Now you are out of check and the position is perfectly legal. You've now
>searched this move without extending it. How do you fix that?
>
>-S.
>
>>
>>
>>
>>Bo Persson
>>bop2@telia.com



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.