Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: pawn structure, pawn hash, square-of-pawn, pawn-races

Author: Robert Hyatt

Date: 13:25:17 08/20/04

Go up one level in this thread


On August 20, 2004 at 13:31:31, Gerd Isenberg wrote:

>On August 20, 2004 at 10:59:16, Robert Hyatt wrote:
>
>>On August 20, 2004 at 05:05:19, Tord Romstad wrote:
>>
>>>On August 20, 2004 at 00:37:26, Eric Oldre wrote:
>>>
>>>>On August 19, 2004 at 18:46:32, Robert Hyatt wrote:
>>>>>
>>>>>
>>>>>Has to do with passed pawns and no pieces on the board.  If you form a square
>>>>>with one side going from the pawn to its promotion square, if the king is inside
>>>>>that square, the pawn can't run and promote.  If the king is outside that square
>>>>>then the pawn promotes and wins.  Simple idea with a few wrinkles to deal with.
>>>>
>>>>Thanks Robert,
>>>>that is actuall something I know i've read about at some point on this board.
>>>>and it's something that i hope i'll get to at some point.
>>>>
>>>>wouldn't you need to have 2 different bit boards? depending on who's turn it is
>>>>to move?
>>>
>>>You don't need even a single bitboard.  Just compare the distance of the
>>>passed pawn to the promotion square to the distance of the defending king
>>>to the promotion square.  Subtract 1 from the defending king's distance
>>>if it is the defender's turn to move.
>>>
>>>Tord
>>>
>>
>>Bitboards don't need any subtraction, any correction for side to move, nor even
>>the exact king square.  It looks something like this:
>>
>>if (white_pawn_race[square of white pawn] & BlackKing) pawn can't run.
>
>Funny, i index with the square of Black King,
>but "and" with a set of all white passers instead ;-)

Either way works.  Is the king in the square of the pawn or is the pawn in the
square of the king?  :)


>
>
>passedPawnsOutsideSquareOfKing[WHITE] =
>     passedPawns[WHITE] & sOutsideSquares[WHITE][bKingSq][color2move];
>
>with passedPawns[WHITE] probably stored in pawn-hash table or generated on the
>fly with some 64-bit instructions:
>
>passedPawns[WHITE] = pawns[WHITE] & ~filldown(allPawns|pawnAttacks[BLACK]);
>
>BitBoard fillDown(BitBoard b)
>{  // Kogge-Stone parallel prefix algorithm
>   b |= b >> 8;
>   b |= b >> 16;
>   b |= b >> 32;
>   return b;
>}
>
>
>>
>>
>>>>
>>>>Eric



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.