diff --git a/source/datagen.cpp b/source/datagen.cpp index ca32451..56bce11 100644 --- a/source/datagen.cpp +++ b/source/datagen.cpp @@ -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(board); - std::uniform_int_distribution dist(0, board.currentMoveIndex); + std::uniform_int_distribution 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;