mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 17:19:36 +00:00
Revert "Clarify the mapping of files to queenside"
This reverts commit 7756344d5d
.
This commit is contained in:
parent
7756344d5d
commit
302e0f70c6
4 changed files with 3 additions and 7 deletions
|
@ -662,7 +662,7 @@ namespace {
|
||||||
|| (pos.pieces(PAWN) & (s + Up)))
|
|| (pos.pieces(PAWN) & (s + Up)))
|
||||||
bonus = bonus / 2;
|
bonus = bonus / 2;
|
||||||
|
|
||||||
score += bonus - PassedFile * map_to_queenside(f);
|
score += bonus - PassedFile * std::min(f, ~f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (T)
|
if (T)
|
||||||
|
|
|
@ -198,7 +198,7 @@ Score Entry::evaluate_shelter(const Position& pos, Square ksq) {
|
||||||
b = theirPawns & file_bb(f);
|
b = theirPawns & file_bb(f);
|
||||||
int theirRank = b ? relative_rank(Us, frontmost_sq(Them, b)) : 0;
|
int theirRank = b ? relative_rank(Us, frontmost_sq(Them, b)) : 0;
|
||||||
|
|
||||||
int d = map_to_queenside(f);
|
int d = std::min(f, ~f);
|
||||||
bonus += make_score(ShelterStrength[d][ourRank], 0);
|
bonus += make_score(ShelterStrength[d][ourRank], 0);
|
||||||
|
|
||||||
if (ourRank && (ourRank == theirRank - 1))
|
if (ourRank && (ourRank == theirRank - 1))
|
||||||
|
|
|
@ -119,7 +119,7 @@ void init() {
|
||||||
|
|
||||||
for (Square s = SQ_A1; s <= SQ_H8; ++s)
|
for (Square s = SQ_A1; s <= SQ_H8; ++s)
|
||||||
{
|
{
|
||||||
File f = map_to_queenside(file_of(s));
|
File f = std::min(file_of(s), ~file_of(s));
|
||||||
psq[ pc][ s] = score + (type_of(pc) == PAWN ? PBonus[rank_of(s)][file_of(s)]
|
psq[ pc][ s] = score + (type_of(pc) == PAWN ? PBonus[rank_of(s)][file_of(s)]
|
||||||
: Bonus[pc][rank_of(s)][f]);
|
: Bonus[pc][rank_of(s)][f]);
|
||||||
psq[~pc][~s] = -psq[pc][s];
|
psq[~pc][~s] = -psq[pc][s];
|
||||||
|
|
|
@ -366,10 +366,6 @@ constexpr Piece operator~(Piece pc) {
|
||||||
return Piece(pc ^ 8); // Swap color of piece B_KNIGHT -> W_KNIGHT
|
return Piece(pc ^ 8); // Swap color of piece B_KNIGHT -> W_KNIGHT
|
||||||
}
|
}
|
||||||
|
|
||||||
inline File map_to_queenside(File f) {
|
|
||||||
return std::min(f, File(FILE_H - f)); // Map files ABCDEFGH to files ABCDDCBA
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr CastlingRights operator&(Color c, CastlingRights cr) {
|
constexpr CastlingRights operator&(Color c, CastlingRights cr) {
|
||||||
return CastlingRights((c == WHITE ? WHITE_CASTLING : BLACK_CASTLING) & cr);
|
return CastlingRights((c == WHITE ? WHITE_CASTLING : BLACK_CASTLING) & cr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue