diff options
| -rw-r--r-- | chess.c | 40 |
1 files changed, 20 insertions, 20 deletions
@@ -1393,13 +1393,13 @@ struct chess_ctx get_uci_ctx(int *wtime, int *btime, int *movetime) print_ctx(&ctx); } else if(!strncasecmp(line, "perft", 5)) - { - int depth; - if(sscanf(line, "perft %d\n", &depth) != 1) - depth = 4; - printf("info depth %d nodes %lu\n", depth, perft(&ctx, depth - 1)); - fflush(stdout); - } + { + int depth; + if(sscanf(line, "perft %d\n", &depth) != 1) + depth = 4; + printf("info depth %d nodes %lu\n", depth, perft(&ctx, depth - 1)); + fflush(stdout); + } else if(!strncasecmp(line, "eval", 4)) { printf("info value WHITE: %d, BLACK: %d\n", eval_position(&ctx, WHITE), eval_position(&ctx, BLACK)); @@ -1461,7 +1461,7 @@ int moveno; struct move_t get_move(const struct chess_ctx *ctx, enum player color) { struct move_t ret; - again: +again: ret.type = NOMOVE; char *ptr = NULL; @@ -1488,34 +1488,34 @@ struct move_t get_move(const struct chess_ctx *ctx, enum player color) printf("id name XenonChess\n"); printf("uciok\n"); fflush(stdout); - goto again; + goto again; } else if(!strncasecmp(line, "isready", 7)) { printf("readyok\n"); fflush(stdout); - goto again; + goto again; } else if(!strncasecmp(line, "help", 4)) { moveno = 0; - best_move_negamax(ctx, DEPTH, -999999, 999999, color, &ret, DEPTH); + best_move_negamax(ctx, DEFAULT_DEPTH, -999999, 999999, color, &ret, DEFAULT_DEPTH, -1); goto done; } else if(!strncasecmp(line, "perft", 5)) { - int depth; - if(sscanf(line, "perft %d\n", &depth) != 1) - depth = 4; - printf("info depth %d nodes %lu\n", depth, perft(ctx, depth - 1)); - fflush(stdout); - goto again; + int depth; + if(sscanf(line, "perft %d\n", &depth) != 1) + depth = 4; + printf("info depth %d nodes %lu\n", depth, perft(ctx, depth - 1)); + fflush(stdout); + goto again; } else if(!strncasecmp(line, "eval", 4)) { - printf("info value WHITE: %d, BLACK: %d\n", eval_position(ctx, WHITE), eval_position(ctx, BLACK)); - fflush(stdout); - goto again; + printf("info value WHITE: %d, BLACK: %d\n", eval_position(ctx, WHITE), eval_position(ctx, BLACK)); + fflush(stdout); + goto again; } if(len < 5) |