added perft command to UCI loop

This commit is contained in:
rektdie committed 2025-03-10 07:45:22 +01:00
1 parent 3e5ed1ad85
commit 728e517c69
1 file changed
+7
+7
View File
@@ -9,6 +9,7 @@
#include "benchmark.h" #include "benchmark.h"
#include <cstring> #include <cstring>
#include "tt.h" #include "tt.h"
#include "perft.h"
Move ParseMove(Board &board, const char* moveString) { Move ParseMove(Board &board, const char* moveString) {
GenerateMoves(board, board.sideToMove); GenerateMoves(board, board.sideToMove);
@@ -240,6 +241,7 @@ void UCILoop(Board &board) {
if (input.find("setoption") != std::string::npos) { if (input.find("setoption") != std::string::npos) {
SetOption(input); SetOption(input);
continue;
} }
// Handling non-UCI "bench" command // Handling non-UCI "bench" command
@@ -247,5 +249,10 @@ void UCILoop(Board &board) {
RunBenchmark(); RunBenchmark();
continue; continue;
} }
if (input.find("perft") != std::string::npos) {
Perft(board, ReadParam("perft", input));
continue;
}
} }
} }