}
void search_position(CBoard_T board, int depth) {
memset(killer_moves, 0, sizeof(killer_moves));
memset(history_moves, 0, sizeof(history_moves));
memset(pv_table, 0, sizeof(pv_table));
memset(pv_length, 0, sizeof(pv_length));
nodes = 0;
Stats_T stats = Stats_new();
for (int crnt = 1; crnt <= depth; crnt++) {
int score = negamax(board, -50000, 50000, crnt);
int score = negamax(stats, board, -50000, 50000, crnt);
printf("info score cp %d depth %d nodes %ld pv ", score, crnt, nodes);
printf("info score cp %d depth %d nodes %ld pv ", score, crnt,
stats->nodes);
for (int i = 0; i < pv_length[0]; i++) {
Move_print_UCI(pv_table[0][i]);
for (int i = 0; i < stats->pv_length[0]; i++) {
Move_print_UCI(stats->pv_table[0][i]);
printf(" ");
}
printf("\n");
}
printf("bestmove ");
Move_print_UCI(pv_table[0][0]);
Move_print_UCI(stats->pv_table[0][0]);
printf("\n");
Stats_free(&stats);
}
void print_info(void) {