]> git.sesse.net Git - stockfish/blobdiff - src/types.h
Fix fragile code to use proper random 64 bit keys.
[stockfish] / src / types.h
index 0c512f5bf3f7544afcae25a0cb451fb31d952ece..c1598561812d949d775bd801d26cc803b61538c8 100644 (file)
@@ -455,6 +455,11 @@ constexpr bool is_ok(Move m) {
   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