Computer Chess Club Archives


Search

Terms

Messages

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

Author: Gerd Isenberg

Date: 23:31:57 12/05/05

Go up one level in this thread


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



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.