Bitboard NeighboringFilesBB[8];
Bitboard ThisAndNeighboringFilesBB[8];
Bitboard InFrontBB[2][8];
-Bitboard NonSlidingAttacksBB[16][64];
+Bitboard StepAttacksBB[16][64];
Bitboard BetweenBB[64][64];
Bitboard SquaresInFrontMask[2][64];
Bitboard PassedPawnMask[2][64];
namespace {
void init_masks();
- void init_non_sliding_attacks();
+ void init_step_attacks();
void init_pseudo_attacks();
void init_between_bitboards();
Bitboard index_to_bitboard(int index, Bitboard mask);
int bishopDeltas[4][2] = {{1,1},{-1,1},{1,-1},{-1,-1}};
init_masks();
- init_non_sliding_attacks();
+ init_step_attacks();
init_sliding_attacks(RAttacks, RAttackIndex, RMask, RShift, RMult, rookDeltas);
init_sliding_attacks(BAttacks, BAttackIndex, BMask, BShift, BMult, bishopDeltas);
init_pseudo_attacks();
FileBB[FILE_A] = FileABB;
RankBB[RANK_1] = Rank1BB;
- for (File f = FILE_B; f <= FILE_H; f++)
+ for (int f = FILE_B; f <= FILE_H; f++)
{
FileBB[f] = FileBB[f - 1] << 1;
RankBB[f] = RankBB[f - 1] << 8;
}
- for (File f = FILE_A; f <= FILE_H; f++)
+ for (int f = FILE_A; f <= FILE_H; f++)
{
NeighboringFilesBB[f] = (f > FILE_A ? FileBB[f - 1] : 0) | (f < FILE_H ? FileBB[f + 1] : 0);
ThisAndNeighboringFilesBB[f] = FileBB[f] | NeighboringFilesBB[f];
}
- for (Rank rw = RANK_7, rb = RANK_1; rw >= RANK_1; rw--, rb++)
+ for (int rw = RANK_7, rb = RANK_2; rw >= RANK_1; rw--, rb++)
{
InFrontBB[WHITE][rw] = InFrontBB[WHITE][rw + 1] | RankBB[rw + 1];
InFrontBB[BLACK][rb] = InFrontBB[BLACK][rb - 1] | RankBB[rb - 1];
BitCount8Bit[b] = (uint8_t)count_1s<CNT32>(b);
}
- void init_non_sliding_attacks() {
+ void init_step_attacks() {
const int step[][9] = {
{0},
Square to = s + Square(step[pc][k]);
if (square_is_ok(to) && square_distance(s, to) < 3)
- set_bit(&NonSlidingAttacksBB[pc][s], to);
+ set_bit(&StepAttacksBB[pc][s], to);
}
}