Small improve for Blockers and Beyond Bitboard
Posted: Sun Jun 10, 2018 5:23 pm
Hi all!
The origional code in Senpai:
If all the attacks disappear (eg.: after first nearest blocker), you are still search!
My idea (Check always the rest attacks):
It does not always help but more than never. Depends on the direction of the search.
- Tamás
The origional code in Senpai:
Code: Select all
static Bit piece_attacks(Square from, Bit tos, Bit pieces) {
for (Bit b = tos & Blocker[from] & pieces; b != 0; b = rest(b)) {
Square to = first(b);
tos &= ~Beyond[from][to];
}
return tos;
}
My idea (Check always the rest attacks):
Code: Select all
static Bit piece_attacks(Square from, Bit tos, Bit pieces) {
for (Bit b = tos & Blocker[from] & pieces; b != 0; b = rest(b) & tos) {
Square to = first(b);
tos &= ~Beyond[from][to];
}
return tos;
}
- Tamás