cosmetic changes
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -19,3 +19,4 @@ brchess
|
||||
/obj/
|
||||
/lib/
|
||||
/.deps/
|
||||
/notused/
|
||||
|
@@ -28,6 +28,8 @@ k4n2/4P3/8/8/8/8/4p3/K4N2 w - - 0 1
|
||||
|
||||
# position after 1.e4
|
||||
rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1
|
||||
# position after 1.Nh3
|
||||
rnbqkbnr/pppppppp/8/8/8/7N/PPPPPPPP/RNBQKB1R b KQkq - 1 1
|
||||
|
||||
# white castled, and can e.p. on c6 black can castle
|
||||
# white is a pawn down
|
||||
|
@@ -459,15 +459,21 @@ int do_pvs(pos_t *pos, __unused char *arg)
|
||||
int debug_level = debug_level_get();
|
||||
long long timer1, timer2;
|
||||
float nodes_sec;
|
||||
eval_t _pvs;
|
||||
|
||||
timer1 = debug_timer_elapsed();
|
||||
pvs(pos, depth, EVAL_MIN, EVAL_MAX, pos->turn == WHITE ? 1 : -1);
|
||||
moves_gen_eval_sort(pos);
|
||||
_pvs = pvs(pos, depth, EVAL_MIN, EVAL_MAX, pos->turn == WHITE ? 1 : -1);
|
||||
timer2 = debug_timer_elapsed();
|
||||
nodes_sec = (float) pos->node_count / ((float) (timer2 - timer1) / (float)NANOSEC);
|
||||
debug_level_set(1);
|
||||
log(1, "best=");
|
||||
move_print(0, pos->bestmove, 0);
|
||||
log(1, " negamax=%d\n", pos->bestmove->negamax);
|
||||
if (pos->bestmove) {
|
||||
move_print(0, pos->bestmove, 0);
|
||||
log(1, " pvs=%d stored=%d\n", _pvs, pos->bestmove->negamax);
|
||||
} else {
|
||||
log(1, "<no-best-move>");
|
||||
}
|
||||
debug_level_set(debug_level);
|
||||
printf("Total nodes: %lu time=%lld %.0f nodes/sec\n",
|
||||
pos->node_count, timer2 - timer1, nodes_sec);
|
||||
|
@@ -164,7 +164,7 @@ eval_t eval_simple(pos_t *pos)
|
||||
|
||||
pos->eval_simple_phase = ENDGAME;
|
||||
# ifdef DEBUG_EVAL
|
||||
log_f(1, "phase = %s.\n", eg? "endgame": "midgame");
|
||||
log_f(5, "phase = %s.\n", eg? "endgame": "midgame");
|
||||
# endif
|
||||
|
||||
for (int color = WHITE; color <= BLACK; ++color) {
|
||||
@@ -173,25 +173,26 @@ eval_t eval_simple(pos_t *pos)
|
||||
u64 _t;
|
||||
|
||||
# ifdef DEBUG_EVAL
|
||||
log_f(1, "p=%u bb=%d %s %s: count=%d val=%ld ", piece, bb, color? "black": "white",
|
||||
log_f(5, "p=%u bb=%d %s %s: count=%d val=%ld ", piece, bb, color? "black": "white",
|
||||
P_SYM(piece), popcount64(pos->bb[color][bb]),
|
||||
popcount64(pos->bb[color][bb]) * P_VALUE(piece));
|
||||
# endif
|
||||
|
||||
eval[color] += popcount64(pos->bb[color][bb]) * P_LETTER(piece);
|
||||
bit_for_each64_2(cur, _t, pos->bb[color][piece]) {
|
||||
bit_for_each64_2(cur, _t, pos->bb[color][bb]) {
|
||||
# ifdef DEBUG_EVAL
|
||||
log(1, "sq=%d:%d ", cur, gg[color][bb][cur]);
|
||||
log(5, "sq=%d:%d ", cur, gg[color][bb][cur]);
|
||||
# endif
|
||||
eval[color] += gg[color][bb][cur];
|
||||
}
|
||||
# ifdef DEBUG_EVAL
|
||||
log(1, "\n");
|
||||
log(5, "\n");
|
||||
# endif
|
||||
}
|
||||
}
|
||||
# ifdef DEBUG_EVAL
|
||||
log_f(1, "white: %d black:%d\n", eval[WHITE], eval[BLACK]);
|
||||
log_f(2, "eval:%d white:%d black:%d\n", eval[WHITE] - eval[BLACK],
|
||||
eval[WHITE], eval[BLACK]);
|
||||
# endif
|
||||
|
||||
return eval[WHITE] - eval[BLACK];
|
||||
|
Reference in New Issue
Block a user