Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: quick bitboard question

Author: Dan Honeycutt

Date: 01:37:15 08/27/05

Go up one level in this thread


On August 27, 2005 at 03:27:16, Tony Werten wrote:

>On August 26, 2005 at 17:01:16, Robert Hyatt wrote:
>
>>On August 26, 2005 at 16:55:28, Dan Honeycutt wrote:
>>
>>>On August 26, 2005 at 16:36:47, Dan Honeycutt wrote:
>>>
>>>>On August 26, 2005 at 16:15:47, Robert Hyatt wrote:
>>>>
>>>>>On August 26, 2005 at 16:11:53, Dan Honeycutt wrote:
>>>>>
>>>>>>Run the lowest bits down the a or h file and you can do pawn captures without
>>>>>>having to mask those files.
>>>>>>
>>>>>>Best
>>>>>>Dan H.
>>>>>
>>>>>
>>>>>How would you avoid masking?  Otherwise the pawn at h2 would still wrap to a3 on
>>>>>a shift...
>>>>
>>>>h8 = bit 0
>>>>h7 = bit 1
>>>>:
>>>>a1 = bit 63
>>>>
>>>>If I ran that the right way, the out of bounds bits are lost and 0's are shifted
>>>>in on the other side.
>>>>
>>>>Best
>>>>Dan H.
>>>
>>>Looking at it, I think that's right.  Take white pawns on g4 and h4 with
>>>captures to the right.  g4 is bit 12 and h4 is bit 4.  My shift is 9 left, so g4
>>>lands on h5 (bit 3) and h4 is discarded.
>>>
>>>Best
>>>Dan H.
>>
>>
>>The problem is that all 64 squares are represented by one bit.  So no matter
>>what you do, a pawn on the edge is going to wrap around to the other side of the
>>board...  Because all 64 bits are shifted at once...
>>
>>Are we talking about the same thing here???
>
>The idea is to limit the wrapping around to pawns on the 1st or the 8th rank.
>Big change nothing will wrap around :)
>
>Tony

Actually, to prevent pawns on the a file from wrapping to the h file, and vice
versa, but, yes.

Best
Dan H.




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.