From 43c7e0caaf4c36ea93a2fdb985dcf4fd73d45153 Mon Sep 17 00:00:00 2001 From: rektdie Date: Mon, 31 Mar 2025 05:24:00 +0200 Subject: [PATCH] fixed some horrible syntax errors --- source/datagen.cpp | 24 +++++++++--------------- source/search.cpp | 2 +- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/source/datagen.cpp b/source/datagen.cpp index 56bce11..9af39ce 100644 --- a/source/datagen.cpp +++ b/source/datagen.cpp @@ -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(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; diff --git a/source/search.cpp b/source/search.cpp index d65ffdb..b3542b8 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -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) {