-/// between_bb() returns a bitboard representing all squares between two squares.
-/// For instance, between_bb(SQ_C4, SQ_F7) returns a bitboard with the bits for
-/// square d5 and e6 set. If s1 and s2 are not on the same line, file or diagonal,
-/// 0 is returned.
+/// pawn_double_attacks_bb() returns the squares doubly attacked by pawns of the
+/// given color from the squares in the given bitboard.
+
+template<Color C>
+constexpr Bitboard pawn_double_attacks_bb(Bitboard b) {
+ return C == WHITE ? shift<NORTH_WEST>(b) & shift<NORTH_EAST>(b)
+ : shift<SOUTH_WEST>(b) & shift<SOUTH_EAST>(b);
+}
+
+
+/// adjacent_files_bb() returns a bitboard representing all the squares on the
+/// adjacent files of the given one.
+
+inline Bitboard adjacent_files_bb(File f) {
+ return shift<EAST>(file_bb(f)) | shift<WEST>(file_bb(f));
+}
+
+
+/// between_bb() returns a bitboard representing all the squares between the two
+/// given ones. For instance, between_bb(SQ_C4, SQ_F7) returns a bitboard with
+/// the bits for square d5 and e6 set. If s1 and s2 are not on the same rank,
+/// file or diagonal, 0 is returned.