mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Rename NonSlidingAttacksBB[] in StepAttacksBB[]
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
c2511243b4
commit
d9113d127b
5 changed files with 13 additions and 13 deletions
|
@ -37,9 +37,9 @@ namespace {
|
||||||
bool is_legal() const;
|
bool is_legal() const;
|
||||||
bool is_immediate_draw() const;
|
bool is_immediate_draw() const;
|
||||||
bool is_immediate_win() const;
|
bool is_immediate_win() const;
|
||||||
Bitboard wk_attacks() const { return NonSlidingAttacksBB[WK][whiteKingSquare]; }
|
Bitboard wk_attacks() const { return StepAttacksBB[WK][whiteKingSquare]; }
|
||||||
Bitboard bk_attacks() const { return NonSlidingAttacksBB[BK][blackKingSquare]; }
|
Bitboard bk_attacks() const { return StepAttacksBB[BK][blackKingSquare]; }
|
||||||
Bitboard pawn_attacks() const { return NonSlidingAttacksBB[WP][pawnSquare]; }
|
Bitboard pawn_attacks() const { return StepAttacksBB[WP][pawnSquare]; }
|
||||||
|
|
||||||
Square whiteKingSquare, blackKingSquare, pawnSquare;
|
Square whiteKingSquare, blackKingSquare, pawnSquare;
|
||||||
Color sideToMove;
|
Color sideToMove;
|
||||||
|
|
|
@ -214,7 +214,7 @@ Bitboard BAttacks[0x1480];
|
||||||
Bitboard SetMaskBB[65];
|
Bitboard SetMaskBB[65];
|
||||||
Bitboard ClearMaskBB[65];
|
Bitboard ClearMaskBB[65];
|
||||||
|
|
||||||
Bitboard NonSlidingAttacksBB[16][64];
|
Bitboard StepAttacksBB[16][64];
|
||||||
Bitboard BetweenBB[64][64];
|
Bitboard BetweenBB[64][64];
|
||||||
|
|
||||||
Bitboard SquaresInFrontMask[2][64];
|
Bitboard SquaresInFrontMask[2][64];
|
||||||
|
@ -231,7 +231,7 @@ uint8_t BitCount8Bit[256];
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
void init_masks();
|
void init_masks();
|
||||||
void init_non_sliding_attacks();
|
void init_step_attacks();
|
||||||
void init_pseudo_attacks();
|
void init_pseudo_attacks();
|
||||||
void init_between_bitboards();
|
void init_between_bitboards();
|
||||||
Bitboard index_to_bitboard(int index, Bitboard mask);
|
Bitboard index_to_bitboard(int index, Bitboard mask);
|
||||||
|
@ -347,7 +347,7 @@ void init_bitboards() {
|
||||||
int bishopDeltas[4][2] = {{1,1},{-1,1},{1,-1},{-1,-1}};
|
int bishopDeltas[4][2] = {{1,1},{-1,1},{1,-1},{-1,-1}};
|
||||||
|
|
||||||
init_masks();
|
init_masks();
|
||||||
init_non_sliding_attacks();
|
init_step_attacks();
|
||||||
init_sliding_attacks(RAttacks, RAttackIndex, RMask, RShift, RMult, rookDeltas);
|
init_sliding_attacks(RAttacks, RAttackIndex, RMask, RShift, RMult, rookDeltas);
|
||||||
init_sliding_attacks(BAttacks, BAttackIndex, BMask, BShift, BMult, bishopDeltas);
|
init_sliding_attacks(BAttacks, BAttackIndex, BMask, BShift, BMult, bishopDeltas);
|
||||||
init_pseudo_attacks();
|
init_pseudo_attacks();
|
||||||
|
@ -384,7 +384,7 @@ namespace {
|
||||||
BitCount8Bit[b] = (uint8_t)count_1s<CNT32>(b);
|
BitCount8Bit[b] = (uint8_t)count_1s<CNT32>(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_non_sliding_attacks() {
|
void init_step_attacks() {
|
||||||
|
|
||||||
const int step[][9] = {
|
const int step[][9] = {
|
||||||
{0},
|
{0},
|
||||||
|
@ -401,7 +401,7 @@ namespace {
|
||||||
Square to = s + Square(step[pc][k]);
|
Square to = s + Square(step[pc][k]);
|
||||||
|
|
||||||
if (square_is_ok(to) && square_distance(s, to) < 3)
|
if (square_is_ok(to) && square_distance(s, to) < 3)
|
||||||
set_bit(&NonSlidingAttacksBB[pc][s], to);
|
set_bit(&StepAttacksBB[pc][s], to);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ extern const Bitboard InFrontBB[2][8];
|
||||||
extern Bitboard SetMaskBB[65];
|
extern Bitboard SetMaskBB[65];
|
||||||
extern Bitboard ClearMaskBB[65];
|
extern Bitboard ClearMaskBB[65];
|
||||||
|
|
||||||
extern Bitboard NonSlidingAttacksBB[16][64];
|
extern Bitboard StepAttacksBB[16][64];
|
||||||
extern Bitboard BetweenBB[64][64];
|
extern Bitboard BetweenBB[64][64];
|
||||||
|
|
||||||
extern Bitboard SquaresInFrontMask[2][64];
|
extern Bitboard SquaresInFrontMask[2][64];
|
||||||
|
|
|
@ -501,7 +501,7 @@ Bitboard Position::attacks_from(Piece p, Square s) const {
|
||||||
case WB: case BB: return attacks_from<BISHOP>(s);
|
case WB: case BB: return attacks_from<BISHOP>(s);
|
||||||
case WR: case BR: return attacks_from<ROOK>(s);
|
case WR: case BR: return attacks_from<ROOK>(s);
|
||||||
case WQ: case BQ: return attacks_from<QUEEN>(s);
|
case WQ: case BQ: return attacks_from<QUEEN>(s);
|
||||||
default: return NonSlidingAttacksBB[p][s];
|
default: return StepAttacksBB[p][s];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -514,7 +514,7 @@ Bitboard Position::attacks_from(Piece p, Square s, Bitboard occ) {
|
||||||
case WB: case BB: return bishop_attacks_bb(s, occ);
|
case WB: case BB: return bishop_attacks_bb(s, occ);
|
||||||
case WR: case BR: return rook_attacks_bb(s, occ);
|
case WR: case BR: return rook_attacks_bb(s, occ);
|
||||||
case WQ: case BQ: return bishop_attacks_bb(s, occ) | rook_attacks_bb(s, occ);
|
case WQ: case BQ: return bishop_attacks_bb(s, occ) | rook_attacks_bb(s, occ);
|
||||||
default: return NonSlidingAttacksBB[p][s];
|
default: return StepAttacksBB[p][s];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -431,12 +431,12 @@ inline Square Position::initial_qr_square(Color c) const {
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline Bitboard Position::attacks_from<PAWN>(Square s, Color c) const {
|
inline Bitboard Position::attacks_from<PAWN>(Square s, Color c) const {
|
||||||
return NonSlidingAttacksBB[make_piece(c, PAWN)][s];
|
return StepAttacksBB[make_piece(c, PAWN)][s];
|
||||||
}
|
}
|
||||||
|
|
||||||
template<PieceType Piece> // Knight and King and white pawns
|
template<PieceType Piece> // Knight and King and white pawns
|
||||||
inline Bitboard Position::attacks_from(Square s) const {
|
inline Bitboard Position::attacks_from(Square s) const {
|
||||||
return NonSlidingAttacksBB[Piece][s];
|
return StepAttacksBB[Piece][s];
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
|
|
Loading…
Add table
Reference in a new issue