stellarUCI Chess engine written in C++20 |
git clone git://git.dimitrijedobrota.com/stellar.git |
Log | Files | Refs | README | LICENSE |
bitboard.hpp (837B)
0 #ifndef STELLAR_BITBOARD_H
1 #define STELLAR_BITBOARD_H
3 #include "utils.hpp"
5 namespace bitboard {
7 void print(U64 bitboard);
9 inline constexpr const U64 notAFile = C64(0xfefefefefefefefe);
10 inline constexpr const U64 notHFile = C64(0x7f7f7f7f7f7f7f7f);
12 typedef U64 (*direction_f)(U64);
13 inline constexpr U64 soutOne(U64 b) { return b >> 8; }
14 inline constexpr U64 nortOne(U64 b) { return b << 8; }
15 inline constexpr U64 eastOne(U64 b) { return (b & notHFile) << 1; }
16 inline constexpr U64 westOne(U64 b) { return (b & notAFile) >> 1; }
17 inline constexpr U64 soEaOne(U64 b) { return (b & notHFile) >> 7; }
18 inline constexpr U64 soWeOne(U64 b) { return (b & notAFile) >> 9; }
19 inline constexpr U64 noEaOne(U64 b) { return (b & notHFile) << 9; }
20 inline constexpr U64 noWeOne(U64 b) { return (b & notAFile) << 7; }
22 } // namespace bitboard
24 #endif