Refactor #26

Merged
rektdie merged 11 commits from refactor into main 2025-03-21 10:52:24 +01:00
2 changed files with 4 additions and 2 deletions
Showing only changes of commit 8d5024a4a4 - Show all commits

No files matched your search

+4 -1
View File
@@ -1,7 +1,8 @@
#include "perft.h"
#include "stopwatch.h"
#include "movegen.h"
U64 HelperPerft(Board board, int depth) {
static U64 HelperPerft(Board board, int depth) {
MOVEGEN::GenerateMoves(board);
if (depth == 1) return board.currentMoveIndex;
@@ -13,6 +14,7 @@ U64 HelperPerft(Board board, int depth) {
Board copy = board;
board.MakeMove(board.moveList[i]);
nodes += HelperPerft(board, depth - 1);
positionIndex--;
board = copy;
}
return nodes;
@@ -28,6 +30,7 @@ void Perft(Board &board, int depth) {
Board copy = board;
board.MakeMove(board.moveList[i]);
U64 nodeCount = HelperPerft(board, depth - 1);
positionIndex--;
board = copy;
totalNodes += nodeCount;
board.moveList[i].PrintMove();
-1
View File
@@ -1,5 +1,4 @@
#pragma once
#include "board.h"
#include "movegen.h"
void Perft(Board &board, int depth);