@@ 254,3 254,31 @@ pub fn rookAttackRays(rook: Square, block: u64) u64 {
}
return resetBit(bitboard, rook);
}
+
+pub const num_rook_relative_occupancies = numRookRelativeOccupancies();
+
+fn numRookRelativeOccupancies() [64]u64 {
+ comptime {
+ @setEvalBranchQuota(2000);
+ var occupancies: [64]u64 = undefined;
+ var i = 0;
+ while (i < 64) : (i += 1) {
+ occupancies[i] = @popCount(u64, maskRookOccupancy(@intToEnum(Square, i)));
+ }
+ return occupancies;
+ }
+}
+
+pub const num_bishop_relative_occupancies = numBishopRelativeOccupancies();
+
+fn numBishopRelativeOccupancies() [64]u64 {
+ comptime {
+ @setEvalBranchQuota(2000);
+ var occupancies: [64]u64 = undefined;
+ var i = 0;
+ while (i < 64) : (i += 1) {
+ occupancies[i] = @popCount(u64, maskBishopOccupancy(@intToEnum(Square, i)));
+ }
+ return occupancies;
+ }
+}