diff options
| author | Adam <adammegarules1@gmail.com> | 2026-07-31 15:14:12 +0200 |
|---|---|---|
| committer | Adam <adammegarules1@gmail.com> | 2026-07-31 15:14:12 +0200 |
| commit | 63f380a48ab21f39962b60837fa487e9f978be95 (patch) | |
| tree | dea75673c058220603c1b34c2b5a0b598f973bad /src/misc.cpp | |
| parent | f47ac9172ce75ab5f359cfebb2c44d6784e956a4 (diff) | |
adding perft
Diffstat (limited to 'src/misc.cpp')
| -rw-r--r-- | src/misc.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/misc.cpp b/src/misc.cpp index 8527fdc..db9240c 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -1,4 +1,6 @@ #include "misc.hpp" +#include "moves.hpp" +#include <cstdint> #include <string> std::string version = "0"; @@ -6,3 +8,17 @@ std::string version = "0"; std::string engine_version() { return "Mono " + version; }; std::string engine_info() { return engine_version() + " by Adam " + "\n"; } + +uint64_t MoveGenTest(int depth, Game *g) { + uint64_t num = 0; + if (depth <= 0) { + return 1; + } + auto moves = GetLegalMoves(g); + for (auto move : moves) { + UndoMove undo = MakeMove(move, g); + num += MoveGenTest(depth - 1, g); + UnMakeMove(undo, g); + } + return num; +} |
