diff options
| author | Franklin Wei <me@fwei.tk> | 2017-05-29 17:55:26 -0400 |
|---|---|---|
| committer | Franklin Wei <me@fwei.tk> | 2017-05-29 17:55:26 -0400 |
| commit | ce674dc4200d5ac6bf32790fe7b53d6e548ad65c (patch) | |
| tree | 940daecd60b2ded6654e4247e058b2757a77593c | |
| parent | b4efaf40b985f3325680fe4fb72efcc74d5d8c7a (diff) | |
| download | xenonchess-ce674dc4200d5ac6bf32790fe7b53d6e548ad65c.zip xenonchess-ce674dc4200d5ac6bf32790fe7b53d6e548ad65c.tar.gz xenonchess-ce674dc4200d5ac6bf32790fe7b53d6e548ad65c.tar.bz2 xenonchess-ce674dc4200d5ac6bf32790fe7b53d6e548ad65c.tar.xz | |
clean up
| -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) |