summaryrefslogtreecommitdiff
path: root/chesshelpers.h
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2022-12-08 23:19:42 -0800
committerKai Stevenson <kai@kaistevenson.com>2022-12-08 23:19:42 -0800
commit972363ca92691f289d32ac5cc787aa1b354da234 (patch)
treefec63d375f56b846887fcd8415fc3f81559e27db /chesshelpers.h
parent40667c9adde27cebdc8bbe9a6ab60f231bc2dfd7 (diff)
started castling. need to implement struct to support rook move and king move at the same time
Diffstat (limited to 'chesshelpers.h')
-rw-r--r--chesshelpers.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/chesshelpers.h b/chesshelpers.h
index be92ba5..b975740 100644
--- a/chesshelpers.h
+++ b/chesshelpers.h
@@ -11,8 +11,12 @@ typedef enum {
} piece_t;
typedef struct BoardState {
int** pieces;
- int blackKingHasMoved;
- int whiteKingHasMoved;
+ //only falsified by moving the king or pawn
+ //does not consider check or empty squares
+ int whiteCanCastleKingside;
+ int whiteCanCastleQueenside;
+ int blackCanCastleKingside;
+ int blackCanCastleQueenside;
int lastPawnMove;
} board_t;
board_t init_board(int** pieces);