return Color(c ^ BLACK); // Toggle color
}
-constexpr Square flip_rank(Square s) {
+constexpr Square flip_rank(Square s) { // Swap A1 <-> A8
return Square(s ^ SQ_A8);
}
-constexpr Square flip_file(Square s) {
+constexpr Square flip_file(Square s) { // Swap A1 <-> H1
return Square(s ^ SQ_H1);
}
constexpr Piece operator~(Piece pc) {
- return Piece(pc ^ 8); // Swap color of piece B_KNIGHT -> W_KNIGHT
+ return Piece(pc ^ 8); // Swap color of piece B_KNIGHT <-> W_KNIGHT
}
constexpr CastlingRights operator&(Color c, CastlingRights cr) {
return from_sq(m) != to_sq(m); // Catch MOVE_NULL and MOVE_NONE
}
+/// Based on a congruential pseudo random number generator
+constexpr Key make_key(uint64_t seed) {
+ return seed * 6364136223846793005ULL + 1442695040888963407ULL;
+}
+
#endif // #ifndef TYPES_H_INCLUDED
#include "tune.h" // Global visibility to tuning setup