Changes

Jump to: navigation, search

Calculon

177 bytes added, 11:06, 24 February 2020
no edit summary
=getPiece=
Calculon's ''getPiece'' routine to get a the [[Pieces#PieceTypeCoding|piece code]] of a square (the least significant one-bit of the passed bitboard pos, typically single populated)
from the [[Bitboard Board-Definition#SixTwo|six piece bitboards]] of its [[Board Representation|board representation]] is an idiosyncratic sample in avoiding emphasizes a central [[Bitboards#getPiece|bitboard weakness]],and the cause to keep a redundant [[8x8 BoardMailbox|8x8 mailbox]] boardrepresentation with some additional [[Incremental Updates|update]] costs during [[Make Move|make]] as well in /[[Avoiding BranchesUnmake Move|avoiding branchesunmake]].
Taking the [[General Setwise Operations#Union|union]] (val) of six piece-specific [[General Setwise Operations#Rotate|rotates]] (left by 1..6) of six piece disjoint [[General Setwise Operations#Intersection|intersections]]
for the absolute difference of the [[BitScan#TrailingZeroCount|trailing zero counts]] of that union and the passed square bitboard (pos) elegantly [[Avoiding Branches|avoids some branches]],but is a bit too much calculation for that purpose <ref>[https://github.com/BarrySW19/CalculonX/blob/master/src/main/java/barrysw19/calculon/engine/BitBoard.java#L418 CalculonX/BitBoard.java at master · BarrySW19/CalculonX · GitHub]</ref>.
<pre>
public class BitBoard { // Position object

Navigation menu