aboutsummaryrefslogtreecommitdiff
path: root/src/misc.cpp
blob: 6737777080ad3c2c2b9876e11025ab2e833f00cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "misc.hpp"
#include "moves.hpp"
#include <cstdint>
#include <string_view>
#include <vector>

/*
 * Return engine name with version number
 */
std::string_view engine_info() { return "Mono 1\n"; }

/*
 * Returns total possible branches with depth X
 */
uint64_t MoveGenTest(uint32_t depth, Game *g) {
  if (depth == 0) {
    return 1;
  }

  uint64_t positionCount = 0;

  std::vector<uint16_t> 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 positionCount;
}