mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 17:19:36 +00:00
simplify opposite_colors
This commit is contained in:
parent
5c2fbcd09b
commit
fefc0c6789
2 changed files with 4 additions and 5 deletions
|
@ -135,6 +135,10 @@ constexpr bool more_than_one(Bitboard b) {
|
||||||
return b & (b - 1);
|
return b & (b - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool opposite_colors(Square s1, Square s2) {
|
||||||
|
return bool(DarkSquares & s1) != bool(DarkSquares & s2);
|
||||||
|
}
|
||||||
|
|
||||||
/// rank_bb() and file_bb() return a bitboard representing all the squares on
|
/// rank_bb() and file_bb() return a bitboard representing all the squares on
|
||||||
/// the given file or rank.
|
/// the given file or rank.
|
||||||
|
|
||||||
|
|
|
@ -413,11 +413,6 @@ constexpr Rank relative_rank(Color c, Square s) {
|
||||||
return relative_rank(c, rank_of(s));
|
return relative_rank(c, rank_of(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool opposite_colors(Square s1, Square s2) {
|
|
||||||
int s = int(s1) ^ int(s2);
|
|
||||||
return ((s >> 3) ^ s) & 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr Direction pawn_push(Color c) {
|
constexpr Direction pawn_push(Color c) {
|
||||||
return c == WHITE ? NORTH : SOUTH;
|
return c == WHITE ? NORTH : SOUTH;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue