Changes

Jump to: navigation, search

Pawn Attacks (Bitboards)

67 bytes added, 11:40, 26 September 2020
no edit summary
'''[[Main Page|Home]] * [[Board Representation]] * [[Bitboards]] * [[Pawn Pattern and Properties]] * Pawn Attacks'''
A pawn captures diagonally forward, and controls or [[Attacks|attacks ]] one (rook pawn) or two squares one step ahead in diagonal [[Direction|direction(s)]]. For white versus black pawns forward and backward are considered relative from either whites or blacks point of view.
=Single Pawn=
<span id="AttacksOfaSinglePawn"></span>
==Attacks==
To get attacks, we use a lookup of pre-calculated pawn-atacksattacks, similar to knight- and king-attacks, except the need to consider color of the pawn.
<pre>
whitePawnAttacks = arrPawnAttacks[white][sqOfWhitePawn];
==Captures==
Only intersection with the opponent pieces is required.
We may include a possible [[En passant|en-passant ]] target square. 
=Pawns set-wise=
. . . . . . . . . . . . . . . .
</pre>
 
 
<span id="PawnAttackMaps"></span>
==Attack Maps==
</pre>
Those attack maps are among other things useful to decide about [[Candidates (Bitboards)|candidates]] and [[Backward Pawns (Bitboards)|backward pawns]] .
<span id="PawnCaptures"></span>
==Captures==
As usual, capture targets are the intersection of attack-sets with opponent pieces. Except [[En passant|en-passant]] captures of course. A reverse shift of disjoint direction-wise sets obtains the pawns which may capture.
To find the pawn set, which can actually capture, on the fly, we can start with the target squares as well:

Navigation menu