TalkChess.com
Hosted by Your Move Chess & Games

Author Message
Gerd Isenberg

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

Post subject: Re: Resource for bit twiddlers    Posted: Fri Jun 01, 2007 8:19 am

 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
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
Subject Author Date/Time
J. Wesley Cleveland Fri May 04, 2007 1:55 am
Gerd Isenberg Mon May 28, 2007 12:40 pm
Gerd Isenberg Mon May 28, 2007 3:16 pm
Gerd Isenberg Mon May 28, 2007 4:35 pm
Gerd Isenberg Wed May 30, 2007 5:55 pm
Pradu Kannan Wed May 30, 2007 10:51 pm
Gerd Isenberg Thu May 31, 2007 6:17 am
Pradu Kannan Fri Jun 01, 2007 12:16 am
Re: Resource for bit twiddlers Gerd Isenberg Fri Jun 01, 2007 8:19 am
Gerd Isenberg Mon Jun 04, 2007 2:58 pm

 Jump to: Select a forum Computer Chess Club Forums----------------Computer Chess Club: General TopicsComputer Chess Club: Tournaments and MatchesComputer Chess Club: Programming and Technical DiscussionsComputer Chess Club: Engine Origins Other Forums----------------Chess Thinkers ForumForum Help and Suggestions
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