Question about SEE algorithm on Chessprogramming Wiki

Discussion of chess software programming and technical issues.

Moderator: Ras

mathmoi
Posts: 290
Joined: Mon Mar 13, 2006 5:23 pm
Location: Québec
Full name: Mathieu Pagé

Question about SEE algorithm on Chessprogramming Wiki

Post by mathmoi »

Hi,

On the Chess Programming Wiki website, there is pseudo code implementation of a SEE algorithm whit x-rays.

Can someone explain why the x-ray attacks are only considered when the piece removed from the board may-x-ray? To me it seems that it's the piece behind the removed piece that is important. No?

Relevant piece of code :

Code: Select all

if ( fromSet & mayXray )
         attadef |= considerXrays(occ, ..);
Harald
Posts: 318
Joined: Thu Mar 09, 2006 1:07 am

Re: Question about SEE algorithm on Chessprogramming Wiki

Post by Harald »

mathmoi wrote:Hi,

On the Chess Programming Wiki website, there is pseudo code implementation of a SEE algorithm whit x-rays.

Can someone explain why the x-ray attacks are only considered when the piece removed from the board may-x-ray? To me it seems that it's the piece behind the removed piece that is important. No?

Relevant piece of code :

Code: Select all

if ( fromSet & mayXray )
         attadef |= considerXrays(occ, ..);
The pieces P, B, R, Q in mayXray are the only ones that could capture
the target coming from one of the 8 xrays. If a knight had captured there
could be no slider coming from that strange direction. If a king had
captured there should be no opponent checking slider behind it and
you are not interested in own additional attacking sliders after your
king was captured.

Harald
mathmoi
Posts: 290
Joined: Mon Mar 13, 2006 5:23 pm
Location: Québec
Full name: Mathieu Pagé

Re: Question about SEE algorithm on Chessprogramming Wiki

Post by mathmoi »

Thanks Harald, that makes sense.