Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bitboarders: detecting open files through flood-fill

Author: Gerd Isenberg

Date: 11:59:47 12/06/05

Go up one level in this thread


On December 06, 2005 at 13:03:16, Alessandro Damiani wrote:

>On December 06, 2005 at 02:31:57, Gerd Isenberg wrote:
>
>>On December 05, 2005 at 17:23:16, Alessandro Damiani wrote:
>>
>>>Just wondering: does anyone use flood-fill to detect open files?
>>>
>>>Alessandro
>>
>>I do it indirectly, i have front-span and back-span of both white and black
>>pawns. Oring all spans and the pawns itself gets a set of all pawn occupied
>>files - and the complement is the open-file set.
>>
>>Direct calculation is like that:
>>
>>bb = allPawns;
>>bb |= bb >>  8;
>>bb |= bb >> 16;
>>bb |= bb >> 32;
>>bb  = ~bb & 0xff; // if you only need a file-set, take it here
>>bb |= bb <<  8;
>>bb |= bb << 16;
>>bb |= bb << 32;
>>openFileSet = bb;
>>
>>Gerd
>
>Thanks. Maybe it's faster than incremental updating. And since you use pawn
>front- and back-spans, detecting open files is cheap.
>
>Do you use pawn front- and back-spans to determine both players' territory?

Yes a kind of... i don't have my source handy - it is usefull for a lot of
semi-open- and open-file stuff, together with attack-spawns. The question is
always to store such things for some time or to save some memory writes and to
do it on the fly when needed.

Gerd

>
>Alessandro



This page took 0.01 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.