Implement Search
This commit is contained in:
32
Search.hpp
32
Search.hpp
@@ -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
|
||||
|
Reference in New Issue
Block a user