summaryrefslogtreecommitdiff
path: root/src/engine/bitboard.c
diff options
context:
space:
mode:
authorAargh Rai <aargh.rai+git@gmail.com>2026-05-31 13:07:46 +0530
committerAargh Rai <aargh.rai+git@gmail.com>2026-05-31 13:07:46 +0530
commit8671756d141292d4ec9747ec8de6e9cf3324777d (patch)
treef14edf785f82cb6c6f3dc61c5ad1eb2689faef1f /src/engine/bitboard.c
parent198bf7c46552059581fda144ec08a9114258123e (diff)
CC in build.c & fen strings
Diffstat (limited to 'src/engine/bitboard.c')
-rw-r--r--src/engine/bitboard.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/engine/bitboard.c b/src/engine/bitboard.c
index 4746020..2d123ea 100644
--- a/src/engine/bitboard.c
+++ b/src/engine/bitboard.c
@@ -20,10 +20,8 @@ position_t position_starting() {
71776119061217280ULL,
},
.castling =
- ((bitboard_t)1 << WHITE_SHORT_CASTLE) |
- ((bitboard_t)1 << WHITE_LONG_CASTLE) |
- ((bitboard_t)1 << BLACK_SHORT_CASTLE) |
- ((bitboard_t)1 << BLACK_LONG_CASTLE),
+ WHITE_SHORT_CASTLE | WHITE_LONG_CASTLE |
+ BLACK_SHORT_CASTLE | BLACK_LONG_CASTLE,
.turn = WHITE_TURN,
.passantable_file = 0,
};
@@ -32,14 +30,12 @@ position_t position_starting() {
void assert_valid_position(position_t position) {
assert(position.castling <=
(
- ((bitboard_t)1 << WHITE_SHORT_CASTLE) |
- ((bitboard_t)1 << WHITE_LONG_CASTLE) |
- ((bitboard_t)1 << BLACK_SHORT_CASTLE) |
- ((bitboard_t)1 << BLACK_LONG_CASTLE)
+ WHITE_SHORT_CASTLE | WHITE_LONG_CASTLE |
+ BLACK_SHORT_CASTLE | BLACK_LONG_CASTLE
)
);
assert(position.turn == WHITE_TURN || position.turn == BLACK_TURN);
- assert(position.passantable_file <= 8);
+ assert(position.passantable_file <= 8); // 0 means no passant
assert(position.bitboards[WHITE_KING] != 0);
assert(position.bitboards[BLACK_KING] != 0);
}