Datagen #46

Merged
rektdie merged 27 commits from datagen into main 2025-04-03 03:54:14 +02:00
Showing only changes of commit ee59c8a455 - Show all commits
+2 -3
View File
@@ -8,14 +8,13 @@
namespace DATAGEN { namespace DATAGEN {
// TODO: Causes segment fault
static void PlayRandMoves(Board &board) { static void PlayRandMoves(Board &board) {
std::random_device dev; std::random_device dev;
std::mt19937 rng(dev()); std::mt19937 rng(dev());
for (int count = 0; count < RAND_MOVES; count++) { for (int count = 0; count < RAND_MOVES; count++) {
MOVEGEN::GenerateMoves<All>(board); 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)]); bool isLegal = board.MakeMove(board.moveList[dist(rng)]);
if (!isLegal) count--; if (!isLegal) count--;
@@ -48,7 +47,7 @@ void Run(int games) {
std::memset(SEARCH::killerMoves, 0, sizeof(SEARCH::killerMoves)); std::memset(SEARCH::killerMoves, 0, sizeof(SEARCH::killerMoves));
SEARCH::history.Clear(); SEARCH::history.Clear();
//PlayRandMoves(board); PlayRandMoves(board);
SEARCH::SearchResults safeResults; SEARCH::SearchResults safeResults;