Implement Search

This commit is contained in:
2022-12-23 18:34:34 +01:00
parent bcf4d66c49
commit 87adca7e66
15 changed files with 337 additions and 66 deletions

View File

@@ -1,8 +1,38 @@
#ifndef CHESS_ENGINE_SEARCH_HPP
#define CHESS_ENGINE_SEARCH_HPP
class Search {
#include "PrincipalVariation.hpp"
#include "Board.hpp"
#include <vector>
#include <limits>
namespace Search {
const int kNegInfinity = std::numeric_limits<int>::min();
struct Node {
explicit Node(const Move move) : move(move) {
}
Node(Node &node) : move(node.move) {
next = std::move(node.next);
value = node.value + 10;
}
std::unique_ptr<Node> next;
Move move;
int value = kNegInfinity;
};
struct RootNode {
std::unique_ptr<Node> child;
Board board;
int value = kNegInfinity;
};
int search(Node *node, const Board &board, unsigned depth);
PrincipalVariation start(const Board &board);
int evaluate(const Board &board);
}
#endif //CHESS_ENGINE_SEARCH_HPP