-/// Functions for computing sliding attack bitboards. Function attacks_bb() takes
-/// 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.
-template<PieceType Pt>
-FORCE_INLINE unsigned magic_index(Square s, Bitboard occ) {
-
- Bitboard* const Masks = Pt == ROOK ? RMasks : BMasks;
- Bitboard* const Magics = Pt == ROOK ? RMagics : BMagics;
- unsigned* const Shifts = Pt == ROOK ? RShifts : BShifts;
-
- if (Is64Bit)
- return unsigned(((occ & Masks[s]) * Magics[s]) >> Shifts[s]);
-
- unsigned lo = unsigned(occ) & unsigned(Masks[s]);
- unsigned hi = unsigned(occ >> 32) & unsigned(Masks[s] >> 32);
- return (lo * unsigned(Magics[s]) ^ hi * unsigned(Magics[s] >> 32)) >> Shifts[s];
-}
-
-template<PieceType Pt>
-inline Bitboard attacks_bb(Square s, Bitboard occ) {
- Bitboard** const Attacks = Pt == ROOK ? RAttacks : BAttacks;
- return Attacks[s][magic_index<Pt>(s, occ)];
-}
-
+/// 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.