Computer Chess Club Archives


Search

Terms

Messages

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

Author: Robert Hyatt

Date: 19:41:00 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


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...



This page took 0.01 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.