Datagen #46

Merged
rektdie merged 27 commits from datagen into main 2025-04-03 03:54:14 +02:00
2 changed files with 10 additions and 16 deletions
Showing only changes of commit 43c7e0caaf - Show all commits

No files matched your search

+9 -15
View File
@@ -22,20 +22,7 @@ static void PlayRandMoves(Board &board) {
}
static bool IsGameOver(Board &board) {
Board copy = board;
// Checkmate / stalemate
int moveCounter = 0;
for (int i = 0; board.currentMoveIndex; i++) {
bool isLegal = copy.MakeMove(board.moveList[i]);
if (!isLegal) continue;
positionIndex--;
moveCounter++;
}
if (moveCounter == 0) return true;
// Draws
return SEARCH::IsDraw(board);
// TODO
}
void Run(int games) {
@@ -51,7 +38,14 @@ void Run(int games) {
SEARCH::SearchResults safeResults;
// TODO: Game loop
// while (!IsGameOver(board)) {
// SEARCH::SearchResults results = SEARCH::SearchPosition<SEARCH::datagen>(board, SearchParams());
// if (!results.bestMove) break;
// safeResults = results;
// board.MakeMove(results.bestMove);
// }
if (std::abs(safeResults.score) >= SEARCH::inf - SEARCH::MAX_DEPTH) {
wdl = board.sideToMove ? 2 : 0;
+1 -1
View File
@@ -125,7 +125,7 @@ static bool IsInsuffMat(Board &board) {
}
bool IsDraw(Board &board) {
return IsFifty || IsInsuffMat || IsThreefold;
return IsFifty(board) || IsInsuffMat(board) || IsThreefold(board);
}
static int GetReductions(Board &board, Move &move, int depth, int moveSeen, int ply) {