ChessUSA.com TalkChess.com
Hosted by Your Move Chess & Games
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Resource for bit twiddlers
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions Flat
View previous topic :: View next topic  
Author Message
Gerd Isenberg



Joined: 08 Mar 2006
Posts: 1802
Location: Hattingen, Germany

PostPost subject: Re: Resource for bit twiddlers    Posted: Fri Jun 01, 2007 8:19 am Reply to topic Reply with quote

Pradu wrote:
Gerd Isenberg wrote:


Hi Pradu,

no, the o^(o-2r) trick with r is subset of o, unfortunately works only for "positive" directions, in this setwise case for the a->h direction (east, right from white points of view on the chessboard) with mapping a1==0, h8==63. For all other seven directions one has to use Steffan Westcott's Kogge-Stone routines.
My mistake. I guess also that my code doesn't work well sometimes for multiple rooks on the same rank when one rook coincides with an occupancy. I need to look at your code a bit more closely.

Code:

               hex    bin        bin
            arithmetical order   reversed according to the a1 = 0 mapping
o              0xDB   11011011   11011011   occupancy including rooks
r = subset(o)  0x12   00010010   01001000   rooks
o - r          0xC9   11001001   10010011   occupancy excluding rooks
o - 2r         0xB7   10110111   11101101   subtracting rooks from either next higher occupancy or borrow
o ^ (o - 2r)   0x6C   01101100   00110110   rook attacks of both rooks

You can not do it the other way around - subtracting none-rooks from rooks to get the opposite direction Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Subject Author Date/Time
Resource for bit twiddlers J. Wesley Cleveland Fri May 04, 2007 1:55 am
      Re: Resource for bit twiddlers Gerd Isenberg Mon May 28, 2007 12:40 pm
            Re: Resource for bit twiddlers Gerd Isenberg Mon May 28, 2007 3:16 pm
                  Re: Resource for bit twiddlers Gerd Isenberg Mon May 28, 2007 4:35 pm
                        Re: Resource for bit twiddlers Gerd Isenberg Wed May 30, 2007 5:55 pm
                              Re: Resource for bit twiddlers Pradu Kannan Wed May 30, 2007 10:51 pm
                                    Re: Resource for bit twiddlers Gerd Isenberg Thu May 31, 2007 6:17 am
                                          Re: Resource for bit twiddlers Pradu Kannan Fri Jun 01, 2007 12:16 am
                                                Re: Resource for bit twiddlers Gerd Isenberg Fri Jun 01, 2007 8:19 am
            Re: Resource for bit twiddlers Gerd Isenberg Mon Jun 04, 2007 2:58 pm
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2001, 2005 phpBB Group
Enhanced with Moby Threads