Changes

Jump to: navigation, search

Checks and Pinned Pieces (Bitboards)

322 bytes added, 12:13, 4 April 2022
no edit summary
<span id="AbsolutePins"></span>
=Absolute Pins=
To detect [[Pin#AbsolutePin|absolute pins]] is necessary for [[Legal Move|legal]] [[Move Generation|move generation]] and may be considered in [[Evaluation|evaluation]]. While there are different approaches, the most common for programs based on single sliding piece attacks rather than direction wise set-wise attack getter, relies on the [[X-ray Attacks (Bitboards)#ModifyingOccupancy|xrayRookAttacks]] or [[X-ray Attacks (Bitboards)#ModifyingOccupancy|xrayBishopAttacks]] routines - called with square of own king and own pieces as blockers. An [[Square Attacked By#Obstructed|in-between lookup]] (Obstructed) determines the set of pinned pieces while [[Bitboard Serialization|traversing]] the pinning pieces<ref>[https://www.talkchess.com/forum3/viewtopic.php?f=7&t=79617&start=2 Re: Pinned Pieces With Bitboards] by tcusr, [[CCC]], April 01, 2022</ref>.
<pre>
pinned = 0;
<span id="OppositeRay"></span>
=Opposite Ray-Directions=
Another idea to determine absolute pins as well as distant check block-targets, or possible discovered check origins, is to apply disjoint direction-wise attacks, as demonstrated in the [[DirGolem]] proposal, where this technique is used for all eight ray-dirctionsdirections. The intersection of direction attacks of potential pinning sliding pieces with the opposite ray-direction attacks of the king treated as sliding super piece, gains enough information if further intersected by empty squares, own, or opponent pieces. For instance as illustrated with a black rook and white king on the same rank, with no, one and two pieces inbetween:
No obstruction, king in check. In-between intersection consists of empty squares as target set to block the distant check:
* [http://www.talkchess.com/forum/viewtopic.php?t=22550 Bitboard of Pinned Pieces] by [[Grant Osborne]], [[CCC]], July 24, 2008
* [http://www.talkchess.com/forum/viewtopic.php?t=41351 Check detection and move generation using bitboards] by [[Lasse Hansen]], [[CCC]], December 06, 2011
* [https://www.talkchess.com/forum3/viewtopic.php?f=7&t=79617 Pinned Pieces With Bitboards] by Andrew Zhuo, [[CCC]], April 01, 2022
=References=
<references />
[[Bitboards|Up one Level]]

Navigation menu