Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: questions?

Author: Russell Reagan

Date: 05:21:47 04/08/04

Go up one level in this thread


On April 08, 2004 at 07:10:29, Daniel Shawul wrote:

>3.I thought i could get In_Check and Checks for free if I use attack tables.
>But there is trouble. If i need to know whether a move checks , I need to
>generate the attack tables which is very costy. Same applies for In_Check.
>For example I need to know whether a move checks if i am using futility pruning.
>So i am doing an incrementally updated checks and in_check to facilitate this.
>Infact it is doing very fine. The in_checks require we are not in check before.
>So I need to generate completely legal move when i am in check.

If you use a board similar to 0x88 which gives you unique square relationships,
you can detect if a move is a checking move fairly easily. Using a lookup table
you can tell if a piece that moves to a square can potentially attack the enemy
king. Most moves will not be able to attack the enemy king, so there is no
reason to scan the board.

For example, a white knight on f3 cannot possibly attack the black king on e8,
so there is no need to scan the board to see if the move Nf3 checks the black
king. If you move a white bishop to b5 and the black king is on e8, then you
only have to scan the squares c6 and d7 to see if they are empty. Using this
approach, you can detect potential checks and pins very efficiently.

There are probably similar tricks if you can do if you use bitboards, but I'll
let someone who has actually worked out those details talk about that, if anyone
has done so.



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.