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) {
|
static bool IsGameOver(Board &board) {
|
||||||
Board copy = board;
|
// TODO
|
||||||
// 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Run(int games) {
|
void Run(int games) {
|
||||||
@@ -51,7 +38,14 @@ void Run(int games) {
|
|||||||
|
|
||||||
SEARCH::SearchResults safeResults;
|
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) {
|
if (std::abs(safeResults.score) >= SEARCH::inf - SEARCH::MAX_DEPTH) {
|
||||||
wdl = board.sideToMove ? 2 : 0;
|
wdl = board.sideToMove ? 2 : 0;
|
||||||
|
|||||||
+1
-1
@@ -125,7 +125,7 @@ static bool IsInsuffMat(Board &board) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsDraw(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) {
|
static int GetReductions(Board &board, Move &move, int depth, int moveSeen, int ply) {
|
||||||
|
|||||||
Reference in new issue
Block a user