X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.h;h=f1db634f1bd058910ef32127bb9f6f956437dd9b;hp=c6dbc647b093dfe1c8d5d425554a76161138adeb;hb=a8e903c33a676decfcf5c721b6b4bfdb4102e5c0;hpb=9dc6d270fc207d6715578b57a1cdf655527ec5fe diff --git a/src/bitboard.h b/src/bitboard.h index c6dbc647..f1db634f 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -135,6 +135,11 @@ constexpr bool more_than_one(Bitboard b) { 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 /// the given file or rank.