Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: how to detect information about pawn structure based on bitboard

Author: Uri Blass

Date: 07:37:32 12/17/02

Go up one level in this thread


On December 17, 2002 at 08:02:27, Gerd Isenberg wrote:

>On December 17, 2002 at 03:40:11, Uri Blass wrote:
>
>>I think to add to my program bitboard that will be used only for pawn structure.
>>
>>2 numbers of 64 bits that are used for white pawns and for black pawns.
>>
>>I want to detect based on these bitboards a lot of information about every pawn
>>and I may want to use the information together with attack tables for
>>evaluation.
>>
>>My question is if using bitboard is a good idea to get the information and
>>if the answer is positive how can I detect the information by bitboards
>>
>>For every pawn I want to detect the following:
>>
>>1)Is it a weak pawn(a pawn that can never be defended by a pawn and cannot go
>>forward to promote without captures and without the risk of being captured by a
>>pawn)
>>2)Is it probably weak pawn(it means that the only way to defend it by a pawn is
>>by capturing the opponent pawn or by letting the opponent to capture the
>>potential defender by a pawn).
>>
>>3)Is it a pawn that is defended by a pawn and if not how many normal pawn moves
>>that are not captures and do not let the opponent to capture by a pawn are
>>needed to defend it by a pawn.
>>
>>4)Is it a passed pawn and if it is a passed pawn how many normal pawn moves are
>>needed to defend it by a pawn.
>>
>>5)Is it a potential passed pawn(is the only way of the opponent to stop it is by
>>letting the player to have another passed pawn)
>>In case that it is a potential passed pawn the question is if it can be done by
>>normal means or the only way to make it a passed pawn is by sacrifices
>>
>>Uri
>
>
>Hi Uri,
>
>OK you have pawnBB[2] with white pawns pawnBB[WHITE] and black pawns
>pawnBB[BLACK]. "allPawns" combines both sets by or.
>
>Some pawn-patterns on the fly (I'm at work and can't look to my sources):
>

Thanks for the information

I thoughtabout your post and understood part of it.
Here are my comments when I tried to explain it to myself.
At this moment I did not understand what is the meaning of duo
and there were some other things that I did not understand.

>pawnAttacksAH[WHITE]  = (pawnBB[WHITE] << 9) & 0xfefefefefefefefe;


for me a1=0... h1=7 a2=8...h8=63

suppose we are in the opening position
I guess pawnBB[WHITE]=(1<<8)+(1<<9)+...(1<<15)

pawnsBB[white]<<9=(1<<17)+(1<<18)+...(1<<24)
0xfefefefefefefefe helps to get rid of the 1<<24 because fe mean 1 only at files
b-h
>pawnAttacksHA[WHITE]  = (pawnBB[WHITE] << 7) & 0x7f7f7f7f7f7f7f7f;

here we need to get rid of h4 that is not attacked

7f is 1 in files a-g so it help for this target.

>pawnAttacks[WHITE]    = pawnAttacksAH[WHITE] | pawnAttacksHA[WHITE];
>pawnDblAttacks[WHITE] = pawnAttacksAH[WHITE] & pawnAttacksHA[WHITE];

understood

squares that are attacked by 1 pawn and squares that are attacked by 2 pawns.

>
>hebel[WHITE]          = pawnAttacks[WHITE] & pawnBB[BLACK];

black pawns that are attacked by white pawns.

>widder[WHITE]         = (pawnBB[WHITE] << 8) & pawnBB[BLACK]


If I understand correctly blocked white pawns by black pawns with distance of
one square.

>                        /* & ~hebel[WHITE] */;
>defended[WHITE]       = pawnAttacks[WHITE] & pawnBB[WHITE];

understood.
>duo[WHITE]            = ((pawnBB[WHITE]<<8)& pawnAttacks[WHITE]
>                                           & ~pawnDblAttacks[WHITE]) >> 8;

What does it mean?
>
>Some helpfull routines:
>
>BitBoard fillUp(BitBoard bb)
>{
>	bb |= (bb<<8);
>        bb |= (bb<<16);
>        bb |= (bb<<32);
>	return bb;
>}
>
>BitBoard fillDown(BitBoard bb)
>{
>	bb |= (bb>>8);
>        bb |= (bb>>16);
>        bb |= (bb>>32);
>	return bb;
>}

I guess that fillup(pawnBB[WHITE]) gives me all the squares that white pawn can
visit without captures by pawns
I will say later in this post that these are the squares that the white pawns
"see" when filldown(pawnBB[BLACK]) are the square that black pawns "see"
correct?



>
>openPawns[WHITE] = pawnBB[WHITE] & ~filldown( fillup(pawnBB[WHITE]) & allPawns);

fillup(pawnBB[WHITE]) & allPawns are
white pawns and black pawns that they "see"

filldown( fillup(pawnBB[WHITE]) & allPawns) are
all the squares that the black pawns(that white pawns "see" them) "see"
~filldown( fillup(pawnBB[WHITE]) & allPawns) are
all the squares that black pawns(that white pawns "see" them) do not "see"
pawnBB[WHITE] & ~filldown( fillup(pawnBB[WHITE]) & allPawns) are
white pawns that black pawns do not "see" so they can promote without captures.

>stop = allPawns | pawnAttacks[BLACK];

stop are pawns that black attack or defend by pawns.

>passedPawns[WHITE] = pawnBB[WHITE] & ~filldown( fillup(pawnBB[WHITE]) & stop)
>                   & ~hebel[WHITE];

I do not understand

hebel[WHITE]; includes only black pawns by the definition that I understood.
It means that
pawnBB[WHITE]=pawnBB[WHITE]&~hebel[WHITE]

>notDefendable[WHITE] = pawnBB[WHITE] & fillup (filldown(pawnAttacks[WHITE]));
>....

fillup (filldown(pawnAttacks[WHITE])) gives me all the files that white attacks
by pawns.

I do not understand why white pawns cannot be in these files.

Uri



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.