Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bitboards and evaluation?

Author: Robert Hyatt

Date: 20:58:11 10/06/98

Go up one level in this thread


On October 06, 1998 at 23:39:38, James Robertson wrote:

>On October 06, 1998 at 16:46:57, Robert Hyatt wrote:
>
>>On October 06, 1998 at 16:00:11, James Robertson wrote:
>>
>>>On October 06, 1998 at 15:06:32, John Coffey wrote:
>>>
>>>>It seems to me that you get limited information from  bitboards.  You
>>>>can find out if any white pieces attack black pieces and vice-a-versa.
>>>>
>>>>What if you want to know who has the greatest mobility?  (i.e. the most
>>>>number of legal moves)  You would have to count bits would you not?
>>>>Is there a fast way to count bits by have table look ups?  (i.e.
>>>>take 16 bits at a time and look up the bit count in a table?)
>>>
>>>That is the way Arasan does it. However, Crafty uses an ingenious method, which
>>>I borrowed (I love tricks I can barely understand). :)
>>>
>>
>>As the Linux kernel hackers say all the time, "use the source, Luke"... :)
>>
>>But in my case, for mobility, I don't count.  That is all pre-computed so that
>>rather than loading the 64 bit attack bitmap, then counting 1 bits, I just load
>>the precomputed 1 bit count to start with...  which means mobility costs me
>>nothing except for the few memory references to obtain these "counts", one for
>>each rank, or file, or diagonal, but note that a complete rank or file or
>>diagonal is done at once, not in two pieces for normal (not-bitmap) programs...
>
>"Help me, Mr. Hyatt. Your my only hope....." :)
>What file contains these functions?
>
>James
>

First, check out chess.h, "MobilityRook()", "MObilityBishop()" and
"MobilityQueen()" functions...  and then utility.c where you find
MobilityDiaga1() and so forth...  there you will see that it
simply does an index into the precomputed mobility arrays, just like
the normal attack generator indexes into the precomputed attack arrays...

Bob





>>
>>
>>
>>>>
>>>>If you want to know who controls the most squares around an enemy king then you
>>>>would have to count bits again?
>>>>
>>>>If you wanted to know who controlled what squares, then it would seem that
>>>>you would be out of luck with bitboards.
>>>>
>>>>John Coffey



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.