-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAI.hpp
More file actions
32 lines (27 loc) · 696 Bytes
/
AI.hpp
File metadata and controls
32 lines (27 loc) · 696 Bytes
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
#ifndef AI_HPP_
#define AI_HPP_
#include <vector>
#include <memory>
#include "Board.hpp"
// self generating tree that stores possible board states n-moves ahead
class Node {
public:
bool color;
Board board;
int value;
bool side;
Move move;
std::vector< Node > childs{};
Node( int depth, Board board_, bool side_, bool color_, Move move_ = Move(0,0,0,0) );
};
// int max( int a, int b );
//
// int min( int a, int b );
// chooses the best move according to value
int minimax( Node& node, int depth, bool isMaximizingPlayer, int alpha, int beta );
class AI {
AI(){}
public:
static Move getBestMove( int maxdepth, Board board, bool side );
};
#endif