Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: question about updating bitboards in an efficient way

Author: Robert Hyatt

Date: 08:19:03 01/09/03

Go up one level in this thread


On January 09, 2003 at 10:18:23, Uri Blass wrote:

>After I make a move of a white pawn I need to change only part of the bitboard
>of the pawns.
>
>Is there a more efficient way to do it then things like?
>
>if (side==LIGHT)
>{
>  pawnattacksAH[LIGHT]=(pawnBB[LIGHT]<<9)&NOTFILEABB;
>  pawnattacksHA[LIGHT]=(pawnBB[LIGHT]<<7)&NOTFILEHBB;
>...
>}
>else
>{
>  pawnattacksAH[DARK]=(pawnBB[DARK]>>7)&NOTFILEABB;
>...
>}
>
>I remember that GCP told me that I can get the information from hash tables.
>
>Updating pawnBB after every make move that change the pawn structure is cheap so
>I do it but I wonder how can I get the information from hash tables when I do
>not want to use static scores for pawn structure but to use other information in
>the board to evaluate pawn structure.
>
>Should I start with doing it without caring about speed and only later care
>about storing the information that I need in hash tables?

First make it work.  Then see if you like the result.  _then_ worry about speed,
hashing, etc.  No need to deal with that until you are sure what you are doing
is
going to be worth keeping.


>
>The information that I want first is squares of the passed pawns that are
>protected by pawns and square of the weak pawns of both sides.
>
>There is another information that today I remember without bitboard(number of
>pawns in every file)
>
>Should I change the way that I remember it to bitboard and if yes how to do it?
>

Using a bitboard, that is so cheap to calculate that I would not worry about it.
 You can
create an 8 bit mask (I don't do this as the idea is not very important IMHO)
with a 1
on every file that white has more than one pawn on.  Then a simple AND/POPCNT
and
you will have the total, if that is important...  But since that doesn't depend
on pieces,
calculate it and store it in the pawn hash, and the cost of doing it will
essentially be zero.




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