From 242b2022ae234e252fe410b276e6d7c971147980 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 15 Aug 2026 20:47:22 +0200 Subject: renaming things --- src/misc.cpp | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'src/misc.cpp') diff --git a/src/misc.cpp b/src/misc.cpp index 79cf74f..6737777 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -2,19 +2,32 @@ #include "moves.hpp" #include #include +#include +/* + * Return engine name with version number + */ std::string_view engine_info() { return "Mono 1\n"; } -uint64_t MoveGenTest(int depth, Game *g) { - uint64_t num = 0; - if (depth <= 0) { +/* + * Returns total possible branches with depth X + */ +uint64_t MoveGenTest(uint32_t depth, Game *g) { + 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); + + uint64_t positionCount = 0; + + std::vector moves = GetLegalMoves(g); + + // for each possible move create new branch + for (uint16_t move : moves) { + Undo undo = MakeMove(move, g); + + positionCount += MoveGenTest(depth - 1, g); + + UndoMove(undo, g); } - return num; + return positionCount; } -- cgit v1.2.3