Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: annoying en passant x-ray

Author: Uri Blass

Date: 15:51:45 11/30/03

Go up one level in this thread


On November 30, 2003 at 18:26:15, Mike Byrne wrote:

>On November 30, 2003 at 17:18:19, Georg v. Zimmermann wrote:
>
>>[b]8/8/8/8/3R1p1k/8/4P3/6K1 w - - 0 1
>>
>>white moves pawn, black can not capture en passant. wonderfull, breaks my new
>>move generator.
>>
>>Uri, I think you are the expert on this. Ideas for workarounds ? :-)
>>
>>But the main reason I am posting is: are there any other situations like the
>>above where I can with one move move 2 pieces out of the way of an x-ray attack
>>?
>>
>>Georg
>
>the way to handle this is to generate all moves, elimnate those that still leave
>you in check, if you don''t have a move and you are not in check, that is
>stalemate and if you are still in check no matter what you do - that's mate.

There is more than one way to do it and I do not do it like that.
I check if some conditions happen before generating a move and not after it.

for en passant capture I usually look if it is pinned not in the direction of
the capture and if it is not pinned in that direction I look if the relevant
king is in the same rank and only if it is in the same rank that happens rarely
I do some more expensive verification to find if the move is legal.

I do not look at my source code at this moment and it is based on memory.

Uri



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.