Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Attack detection with bitboards: alternative to "rotated bitboards"

Author: Robert Hyatt

Date: 05:53:12 12/06/99

Go up one level in this thread


On December 05, 1999 at 22:47:06, KarinsDad wrote:

>On December 05, 1999 at 11:00:19, Robert Hyatt wrote:
>
>[snip]
>>
>>
>>you need 256 entries because that is the number of possible states of any rank
>>or diagonal.
>
>Hmmmm. I'll have to think about this for a while. Seems wasteful on the surface.
>
>>
>>As far as 64 bits goes, within 5 years that is _all_ we will have.  Better to
>>plan for the future.  It is almost the present.  :)
>
>Heck, I cannot even get the present working. ;)
>
>KarinsDad :)


Think about this: you want a 64 bit value, which has 1 bits set for each square
the piece in question attacks.  For sliding pieces, look at a rank.  The rank
can have exactly 256 different states when each square is represented by 1 bit,
with 0=empty and 1=occupied.  You grab the rank contents and use that as an
index into this 256 element array to instantly look up the squares the piece
attacks along that rank.



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.