Computer Chess Club Archives


Search

Terms

Messages

Subject: Question about bitboards and crafty's code

Author: blass uri

Date: 09:22:05 12/03/99


1)I am interested to know if bitboards help to do programs faster relative to
arrays of attack.

I started to try to write a chess program and
I think to use arrays like rookattack[i]-the number of the attacking rooks of
square i and I am interested to know if there is a way to be faster by
bitboards.

2)I found this piece of code in crafty at evaluate.c

if (WhiteBishops) {
    if (WhiteBishops&mask_A7H7) {
      if (WhiteBishops&SetMask(A7) && SetMask(B6)&BlackPawns)
        score-=BISHOP_TRAPPED;
      else if (WhiteBishops&SetMask(H7) && SetMask(G6)&BlackPawns)
        score-=BISHOP_TRAPPED;
    }
  }

a)is it possible to save time by avoiding the first line
if (WhiteBishops)?

b)I guess that whitebishops is a 64 digits number and that this number gets 1
for every square with a white bishop.
I guess that mask_a7h7 gets 1 only for WhiteBishops at a7 or h7 and that the
other 62 digits of it are 0

Am I right?

c)what do the 64 bit numbers SetMask(A7),Setmask(B6) mean?

d)Do bitboards help to evaluate the trapped bishop faster relative to evaluating
the same information without bitboards?

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.