fixed some horrible syntax errors
This commit is contained in:
1 parent
ee59c8a455
commit
43c7e0caaf
2 files changed
+10
-16
No files matched your search
+9
-15
@@ -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
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user