mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Small renaming
No functional change.
This commit is contained in:
parent
28bc8ed462
commit
1f40cd6d02
4 changed files with 12 additions and 12 deletions
|
@ -82,7 +82,7 @@ extern Bitboard PseudoAttacks[PIECE_TYPE_NB][SQUARE_NB];
|
||||||
|
|
||||||
extern int SquareDistance[SQUARE_NB][SQUARE_NB];
|
extern int SquareDistance[SQUARE_NB][SQUARE_NB];
|
||||||
|
|
||||||
const Bitboard BlackSquares = 0xAA55AA55AA55AA55ULL;
|
const Bitboard DarkSquares = 0xAA55AA55AA55AA55ULL;
|
||||||
|
|
||||||
/// Overloads of bitwise operators between a Bitboard and a Square for testing
|
/// Overloads of bitwise operators between a Bitboard and a Square for testing
|
||||||
/// whether a given bit is set in a bitboard, and for setting and clearing bits.
|
/// whether a given bit is set in a bitboard, and for setting and clearing bits.
|
||||||
|
@ -214,6 +214,14 @@ inline Bitboard passed_pawn_mask(Color c, Square s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// squares_of_color() returns a bitboard representing all squares with the same
|
||||||
|
/// color of the given square.
|
||||||
|
|
||||||
|
inline Bitboard squares_of_color(Square s) {
|
||||||
|
return DarkSquares & s ? DarkSquares : ~DarkSquares;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// squares_aligned() returns true if the squares s1, s2 and s3 are aligned
|
/// squares_aligned() returns true if the squares s1, s2 and s3 are aligned
|
||||||
/// either on a straight or on a diagonal line.
|
/// either on a straight or on a diagonal line.
|
||||||
|
|
||||||
|
@ -223,14 +231,6 @@ inline bool squares_aligned(Square s1, Square s2, Square s3) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// same_color_squares() returns a bitboard representing all squares with
|
|
||||||
/// the same color of the given square.
|
|
||||||
|
|
||||||
inline Bitboard same_color_squares(Square s) {
|
|
||||||
return BlackSquares & s ? BlackSquares : ~BlackSquares;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// Functions for computing sliding attack bitboards. Function attacks_bb() takes
|
/// Functions for computing sliding attack bitboards. Function attacks_bb() takes
|
||||||
/// a square and a bitboard of occupied squares as input, and returns a bitboard
|
/// a square and a bitboard of occupied squares as input, and returns a bitboard
|
||||||
/// representing all squares attacked by Pt (bishop or rook) on the given square.
|
/// representing all squares attacked by Pt (bishop or rook) on the given square.
|
||||||
|
|
|
@ -468,7 +468,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
||||||
if (bonus && (ei.attackedBy[Us][PAWN] & s))
|
if (bonus && (ei.attackedBy[Us][PAWN] & s))
|
||||||
{
|
{
|
||||||
if ( !pos.pieces(Them, KNIGHT)
|
if ( !pos.pieces(Them, KNIGHT)
|
||||||
&& !(same_color_squares(s) & pos.pieces(Them, BISHOP)))
|
&& !(squares_of_color(s) & pos.pieces(Them, BISHOP)))
|
||||||
bonus += bonus + bonus / 2;
|
bonus += bonus + bonus / 2;
|
||||||
else
|
else
|
||||||
bonus += bonus / 2;
|
bonus += bonus / 2;
|
||||||
|
|
|
@ -104,7 +104,7 @@ namespace {
|
||||||
e->kingSquares[Us] = SQ_NONE;
|
e->kingSquares[Us] = SQ_NONE;
|
||||||
e->semiopenFiles[Us] = 0xFF;
|
e->semiopenFiles[Us] = 0xFF;
|
||||||
e->pawnAttacks[Us] = shift_bb<Right>(ourPawns) | shift_bb<Left>(ourPawns);
|
e->pawnAttacks[Us] = shift_bb<Right>(ourPawns) | shift_bb<Left>(ourPawns);
|
||||||
e->pawnsOnSquares[Us][BLACK] = popcount<Max15>(ourPawns & BlackSquares);
|
e->pawnsOnSquares[Us][BLACK] = popcount<Max15>(ourPawns & DarkSquares);
|
||||||
e->pawnsOnSquares[Us][WHITE] = pos.count<PAWN>(Us) - e->pawnsOnSquares[Us][BLACK];
|
e->pawnsOnSquares[Us][WHITE] = pos.count<PAWN>(Us) - e->pawnsOnSquares[Us][BLACK];
|
||||||
|
|
||||||
// Loop through all pawns of the current color and score each pawn
|
// Loop through all pawns of the current color and score each pawn
|
||||||
|
|
|
@ -37,7 +37,7 @@ struct Entry {
|
||||||
Score pawns_value() const { return value; }
|
Score pawns_value() const { return value; }
|
||||||
Bitboard pawn_attacks(Color c) const { return pawnAttacks[c]; }
|
Bitboard pawn_attacks(Color c) const { return pawnAttacks[c]; }
|
||||||
Bitboard passed_pawns(Color c) const { return passedPawns[c]; }
|
Bitboard passed_pawns(Color c) const { return passedPawns[c]; }
|
||||||
int pawns_on_same_color_squares(Color c, Square s) const { return pawnsOnSquares[c][!!(BlackSquares & s)]; }
|
int pawns_on_same_color_squares(Color c, Square s) const { return pawnsOnSquares[c][!!(DarkSquares & s)]; }
|
||||||
int semiopen(Color c, File f) const { return semiopenFiles[c] & (1 << int(f)); }
|
int semiopen(Color c, File f) const { return semiopenFiles[c] & (1 << int(f)); }
|
||||||
int semiopen_on_side(Color c, File f, bool left) const {
|
int semiopen_on_side(Color c, File f, bool left) const {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue