Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Getting out of check

Author: Bruce Moreland

Date: 23:57:11 12/26/02

Go up one level in this thread


On December 26, 2002 at 20:40:51, Russell Reagan wrote:

>Will this correctly handle all of the cases for generating moves when in check?
>
>(scope denoted by whitespace indentation)
>if number of pieces giving check is 1

Calculating this number is difficult.

>    generate moves that capture the piece giving check
>    generate moves that block the checking piece
>generate capture moves for king
>generate non-capture moves for king

Or more generally, generate all moves for the king.

>Maybe someone can give some advice on generating moves when in check. I think I
>have all of the cases covered, but I'm not 100% sure.
>
>Also, is it possible for there to be more than 2 pieces delivering check at the
>same time? I don't think it can be achieved in a legal game. Anyone know for
>sure?

It is easy to prove that this is impossible.  A piece move can check, and it can
expose a discovery.  Castling cannot expose a discovery, so that's not too
weird.  En-passant can expose two discoveries, but if it does that, the
capturing pawn can't check.

bruce

>
>Russell



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.