fixed PlayRandMoves()

This commit is contained in:
rektdie committed 2025-03-31 05:06:28 +02:00
1 parent ebdf295eec
commit ee59c8a455
1 file changed
+2 -3
+2 -3
View File
@@ -8,14 +8,13 @@
namespace DATAGEN {
// TODO: Causes segment fault
static void PlayRandMoves(Board &board) {
std::random_device dev;
std::mt19937 rng(dev());
for (int count = 0; count < RAND_MOVES; count++) {
MOVEGEN::GenerateMoves<All>(board);
std::uniform_int_distribution<std::mt19937::result_type> dist(0, board.currentMoveIndex);
std::uniform_int_distribution<std::mt19937::result_type> dist(0, board.currentMoveIndex - 1);
bool isLegal = board.MakeMove(board.moveList[dist(rng)]);
if (!isLegal) count--;
@@ -48,7 +47,7 @@ void Run(int games) {
std::memset(SEARCH::killerMoves, 0, sizeof(SEARCH::killerMoves));
SEARCH::history.Clear();
//PlayRandMoves(board);
PlayRandMoves(board);
SEARCH::SearchResults safeResults;