Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Wait, I see it.

Author: Bas Hamstra

Date: 13:05:32 01/15/03

Go up one level in this thread


On January 15, 2003 at 13:58:25, Russell Reagan wrote:

>On January 15, 2003 at 07:49:44, Bas Hamstra wrote:
>
>>In think I understand now. You do it for the 2 rooks simulteneously. "Floodfill"
>>(not the correct term, I know) does not necessarily have to start at bit 0, it
>>can be anywhere. Wow. This really is an enhancement of the X ^ (X-2) trick. This
>>opens interesting possibilities, like generating "UP" attacks for all rooks and
>>queens at once, and masking only later (when it's needed) with a RookMask[Sq].
>>
>>RookAttacks for one rook at a given square = RookMask[Sq] & UP & LEFT;
>>
>>(plus the same for the reversed bitboard)
>>
>>Bas.
>
>Hi Bas,
>
>How would you use x^(x-2) trick to generate "up" attacks and attacks in other
>directions?

First, forget about my previous post. Sorry if I am a bit slow. I can see how to
do it for one piece though. Suppose you have a queen at c1 and want to generate
UP attacks.

- Shifted = Occupied << C3     // shift Occupied so that Queen is at A
-
shift Occupied so that queen is at A1
-





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.