Author: Robert Hyatt
Date: 12:00:44 02/16/04
Go up one level in this thread
On February 16, 2004 at 14:18:19, Uri Blass wrote: >On February 16, 2004 at 14:16:14, Dann Corbit wrote: > >>On February 16, 2004 at 13:59:29, Uri Blass wrote: >> >>>On February 16, 2004 at 13:51:35, Dann Corbit wrote: >>> >>>>On February 16, 2004 at 13:38:50, Robert Hyatt wrote: >>>>>On February 16, 2004 at 13:22:56, Uri Blass wrote: >>>>[snip] >>>>>>It is important to make things clear because Dann Corbit in the winboard forum >>>>>>even suggested that it may be a bad idea to read crafty's code >>>>> >>>>>This doesn't make much sense to me. I can't imagine a better way to learn about >>>>>the insides of a chess program than to look at the source, particularly when the >>>>>program is written like Crafty with about a 50-50 ratio of instructions to >>>>>comments. If borrowing ideas was bad, then he might be right. But you can look >>>>>at a program without borrowing source... >>>> >>>>If you are not allowed to apply what you learn, what is the purpose of reading >>>>it? >>> >>>If you already started from a different data structure than Crafty then applying >>>what you learn will usually result in a different code. >>> >>>If you start from almost the same structure of crafty then you are in a problem >>>and Bob explain that he used the the order of bits in bitboards in Crafty is not >>>natural to use for a new bitboard program. >> >>If you learned by reading crafty, it would seem natural to you. >>I learned bitboards from James Swafford (in fact, it is the only tutorial on >>bitboards that I ever really understood well) so my code will look similar to >>his, I imagine. > >It seems natural to me to have a1=0 h1=7 h8=63 in bitboards and I understood >that Crafty does not do it. > >Uri I do a1 = 0. The problem is that for me, a1 = the leftmost or most significant bit. On the Cray, the "leading zero" instruction counts 0 bits from the left end, which is the same thing as finding the first 1 bit from the left end. On the intel platform, the LSB is bit 0, the MSB is bit 63, on the Cray the LSB is bit 63, the MSB is bit 0. It isn't an issue to make bit 0 represent a1. h1, a8 or h8. It is the fact that I have the leftmost bit as bit 0, which is backward for Intel. I therefore have to compute "bit = 63 - bsf(bitboard)" where everyone else doing bitboards just does "bit = bsf(bitboard)". I'll probably change that one day as it does have a cost associated with it...
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.