Changes

Jump to: navigation, search

Subtracting a Rook from a Blocking Piece

328 bytes added, 10:16, 27 April 2019
no edit summary
<span id="oxoro2r"></span>
=o^(o-2r)=
This trick is known as '''o^(o-2r)'''. Assuming rook '''r''' is member of the [[Occupancy|occupancy]] '''o''' may include , the rook single subtract would only clear that '''r''' or -bit, therefor subtracting '''2r''' is required to borrow from the closest blocker bit in '''o'''. However, even if '''o''' may notinclude the rook bit, the subtraction or of '''2r ''' does not affect this that bit, and - no matter whether it '''r''' is set in '''o''' or not, the [[General Setwise Operations#ExclusiveOr|xor operation]] only yields results in the changed bits as sliding rook attacks. Unfortunately it , due to borrow is propagated in direction of arithmetical more significant bits, the trick only works on [[On an empty Board#PositiveRays|positive rays]], but can be applied for [[Files|files]] or [[Diagonals|diagonals]] with leading and trailing [[General Setwise Operations#Intersection|intersections]] with the [[On an empty Board#LineAttacks|line-masks]]. For instance, north attacks of a rook on d2:
<pre>
occupancy & filemask[d] = potential blockers

Navigation menu