diff options
| author | Aargh Rai <aargh.rai+git@gmail.com> | 2026-06-02 17:39:09 +0530 |
|---|---|---|
| committer | Aargh Rai <aargh.rai+git@gmail.com> | 2026-06-02 17:39:09 +0530 |
| commit | 058f12c699c9183f93f280ad7eb54c8a1b25f523 (patch) | |
| tree | f06f21c94666243b80a5823c3932349dba4ed3cc /src/engine/bitboard.h | |
| parent | df577a30f2df1d60a0254403147fd2077a7c8b42 (diff) | |
added move flags
will try stockfish later dw
Diffstat (limited to 'src/engine/bitboard.h')
| -rw-r--r-- | src/engine/bitboard.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/engine/bitboard.h b/src/engine/bitboard.h index 8515f5d..ecd8c35 100644 --- a/src/engine/bitboard.h +++ b/src/engine/bitboard.h @@ -23,10 +23,10 @@ enum { }; enum { - WHITE_SHORT_CASTLE = 1 << 0, - WHITE_LONG_CASTLE = 1 << 1, - BLACK_SHORT_CASTLE = 1 << 2, - BLACK_LONG_CASTLE = 1 << 3, + WHITE_SHORT_CASTLE = 1 << 0, + WHITE_LONG_CASTLE = 1 << 1, + BLACK_SHORT_CASTLE = 1 << 2, + BLACK_LONG_CASTLE = 1 << 3, }; enum { @@ -65,8 +65,22 @@ typedef struct { position_t position_starting(); void assert_valid_position(position_t position); bool check_valid_position(position_t position); -bitboard_t whites(position_t position); -bitboard_t blacks(position_t position); +#define whites(position) \ + position.bitboards[WHITE_KING] | \ + position.bitboards[WHITE_QUEEN] | \ + position.bitboards[WHITE_ROOK] | \ + position.bitboards[WHITE_BISHOP] | \ + position.bitboards[WHITE_KNIGHT] | \ + position.bitboards[WHITE_PAWN] + +#define blacks(position) \ + position.bitboards[BLACK_KING] | \ + position.bitboards[BLACK_QUEEN] | \ + position.bitboards[BLACK_ROOK] | \ + position.bitboards[BLACK_BISHOP] | \ + position.bitboards[BLACK_KNIGHT] | \ + position.bitboards[BLACK_PAWN] + void print_bitboard(bitboard_t bitboard); |
