From 2d5966fe16f255bf280db68aa46fd6b759d9ebe3 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sat, 27 May 2017 19:04:08 -0400 Subject: perft and FEN parsing --- chess.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'chess.h') diff --git a/chess.h b/chess.h index 68bc168..9455c58 100644 --- a/chess.h +++ b/chess.h @@ -46,7 +46,7 @@ struct chess_ctx { struct piece_t board[8][8]; /* [rank (y)],[file (x)] */ enum player to_move; bool king_moved[2]; - bool rook_moved[2][2]; /* [player][0=first file,1=eighth file] */ + bool rook_moved[2][2]; /* [player][0=first file (queenside),1=eighth file (kingside)] */ bool en_passant[2][8]; }; @@ -67,3 +67,5 @@ int best_move_negamax(const struct chess_ctx *ctx, int depth, int a, int b, int color, struct move_t *best); bool can_castle(const struct chess_ctx *ctx, int color, int style); +uint64_t perft(const struct chess_ctx *ctx, int depth); +struct chess_ctx ctx_from_fen(const char *fen); -- cgit v1.1