I m trying to calculate ray attacks given the index of a 64-bit Long bitboard representation:
(defn se [board index]
"Produces a ray attack from the indexed bit in the south-east direction"
(reduce bit-or
(for [bit (rest (range index 0 -7))]
(bit-flip board bit))))
猛烈的袭击(从档案或级别上看)很容易发生。 然而,上述法典问题最终导致“大主教”攻击的可能性如下:
00000000
00100000
01000000
10000001
00000010
00000100
00001000
00010000
How should I account for the case when the piece goes off the edge of the board? I m using big endian mapping (A8 = 0, H1 = 63).