#include <cassert>
#include "book.h"
-#include "mersenne.h"
#include "movegen.h"
using namespace std;
//// Functions
////
+// C'tor. Make random number generation less deterministic, for book moves
+Book::Book() {
+
+ for (int i = abs(get_system_time() % 10000); i > 0; i--)
+ RKiss.rand32();
+}
+
/// Destructor. Be sure file is closed before we leave.
// high score it has more probability to be choosen then a one with
// lower score. Note that first entry is always chosen.
scoresSum += score;
- if (int(genrand_int32() % scoresSum) < score)
+ if (int(RKiss.rand32() % scoresSum) < score)
bookMove = entry.move;
}
if (!bookMove)