Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: definition of clones: Danchess an Crafty (another note)

Author: Uri Blass

Date: 23:15:25 02/16/04

Go up one level in this thread


On February 16, 2004 at 22:41:00, Robert Hyatt wrote:

>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
>
>
>This will make bitmaps insanely difficult to visualize.  Remember that bit 0 is
>the LSB (or rightmost bit).  That means your chess board is going to look like
>this when you display a bitboard as a hex number:
>
>
>
>             h1 g1 f1 e1 d1 c1 b1 a1
>
>Because the rightmost 8 bits would be displayed in that order.  That could drive
>someone to drink drain cleaner.  I might be more tempted to make bit 0 either
>square h8, or h1 instead, so that things are not impossible to debug...
>
>It would work as a1 of course, but it would take some thinking when working with
>the hex masks...
>
>My main goal is to just invert my numbering scheme, so that bit 0 becomes bit
>63, and so forth, to get rid of the subtract everywhere...  Not to mention
>needing an extra register regularly...

I admit that I do not understand much about bitboards and I did not care much
about speed in bitboards but about code that is easier to understand(most of the
time of movei is not used in bitboards so there is not much that I can get).

I do not have functions with the name firstone and lastone because for me their
meaning is not clear from the name because there are two ways to think about
bitboards that lead to opposite explanations based on the name.

1)I can think of a bitboard as 64 bit number and in this case firstone can mean
the most significant bit
2)I can think of a bitboard in a different way as a binary array of 64 numbers
when instead of having int iswhitepawn[63] when iswhitepawn can get 0 or 1 I
have one number of 64 bits and in this case firstone may mean the less
significant bit.

I simply decided not to have firstone and lastone and have smallestpower and
biggestpower.
For me this is clear when I use these names because it is clear from the names
that I should look at the bitboard as a number and not think about the original
meaning of array of 64 numbers.

Uri



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.