Changes

Jump to: navigation, search

Passed Pawns (Bitboards)

2,781 bytes added, 12:30, 10 May 2018
Created page with "'''Home * Board Representation * Bitboards * Pawn Pattern and Properties * Passed Pawns''' FILE:Pawn's_Dream.jpg|border|right|thumb|link=http://ww..."
'''[[Main Page|Home]] * [[Board Representation]] * [[Bitboards]] * [[Pawn Pattern and Properties]] * Passed Pawns'''

[[FILE:Pawn's_Dream.jpg|border|right|thumb|link=http://www.carinajorgensen.com/Chess/pawnsdream.php|[[Arts#Jørgensen|Carina Jørgensen]], Pawn's Dream <ref>[http://www.carinajorgensen.com/Chess/pawnsdream.php Pawn's Dream] 2009 by [[Arts#Jørgensen|Carina Jørgensen]]</ref> ]]

A '''Passed Pawn''', also called '''Passer''', has no opponent pawns in front on the same or adjacent files. In Bitboards, passers may be determined square- or set-wise.
<span id="SinglePasser"></span>
=Single Passer=
Working in the ''square centric'' world of the board, thus using a square index of '''one''' particular pawn, likely from [[Bitboard Serialization|bitboard traversal]], to lookup pre-calculated pattern.

For a single pawn we need to access a lookup-table to get all squares on the same file and adjacent file in front of the pawn. This is what we call front-span and attack spans. If the intersection of those span-union with the set of opponent pawns is empty, it is a passed pawn.
<pre>
U64 arrFrontSpans[2][64];

if ( (arrFrontSpans[white][sqOfWhitePawn] & pawnBB[black]) == 0 ) -> pawn is a passer
</pre>

<pre>
arrFrontSpans[white][d4]
. . 1 1 1 . . .
. . 1 1 1 . . .
. . 1 1 1 . . .
. . 1 1 1 . . .
. . . p . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
</pre>
Pawns ready to promote don't need above condition, the appearance on the 7th (or 2nd) rank is already sufficient to be a passer:
<pre>
if ( sqOfWhitePawn >= a7 ) -> white pawn may promote
if ( sqOfBlackPawn <= h2 ) -> black pawn may promote
</pre>

<span id="PassersSetwise"></span>
=Passers set-wise=
Working in the ''bitboard centric'' world to determine pawn related pattern ''set-wise''.

Passers are the pawns [[General Setwise Operations#RelativeComplement|outside]] the union of all opponent [[Pawn Spans|frontspans]] and [[Attack Spans|attack-frontspans]].

<pre>
U64 wPassedPawns(U64 wpawns, U64 bpawns) {
U64 allFrontSpans = bFrontSpans(bpawns);
allFrontSpans |= eastOne(allFrontSpans)
| westOne(allFrontSpans);
return wpawns & ~allFrontSpans;
}

U64 bPassedPawns(U64 bpawns, U64 wpawns) {
U64 allFrontSpans = wFrontSpans(wpawns);
allFrontSpans |= eastOne(allFrontSpans)
| westOne(allFrontSpans);
return bpawns & ~allFrontSpans;
}
</pre>

=See also=
* [[Candidate Passed Pawn]]
* [[Candidates (Bitboards)]]
* [[Hidden Passed Pawn]]
* [[Passed Pawn]]
* [[Passed Pawn Extensions]]
* [[King Pattern#SetwiseRuleoftheSquare|Set-wise Rule of Squares]]

=External Links=
* [https://en.wikipedia.org/wiki/Passed_pawn Passed pawn from Wikipedia]

=References=
<references />

'''[[Pawn Pattern and Properties|Up one Level]]'''

Navigation menu