const static int hashNull = 0;
};
class PVTable {
public:
Move best(uint8_t ply = 0) { return table[0][ply]; }
void start(uint8_t ply) { length[ply] = ply; }
void store(Move move, uint8_t ply) {
table[ply][ply] = move;
for (uint8_t i = ply + 1; i < length[ply + 1]; i++)
table[ply][i] = table[ply + 1][i];
length[ply] = length[ply + 1];
}
friend std::ostream &operator<<(std::ostream &os, const PVTable &pvtable);
private:
Move table[MAX_PLY][MAX_PLY] = {{}};
uint8_t length[MAX_PLY] = {0};
};
std::ostream &operator<<(std::ostream &os, const PVTable &pvtable) {
for (uint8_t i = 0; i < pvtable.length[0]; i++)
os << pvtable.table[0][i] << " ";
return os;
}
static const uci::Settings *settings = nullptr;
static Board board;
static TTable ttable;
static RTable rtable;
static Move pv_table[MAX_PLY][MAX_PLY];
static PVTable pvtable;
static Move killer[2][MAX_PLY];
static U32 history[12][64];
static uint8_t pv_length[MAX_PLY];
static bool follow_pv;
static U64 nodes;
static U32 ply;
static uint8_t ply;
U32 inline move_list_score(Move move) {
const piece::Type type = board.get_square_piece_type(move.source());