stellar

Stellar - UCI Chess engine written in C++20
git clone git://git.dimitrijedobrota.com/stellar.git
Log | Files | Refs | README | LICENSE

commit 9c244b30d8dce60a01473b95f7b6eb76cf29ed2c
parent 81a01aa0657d9d75a49aba55ae606d5da5e79ff9
Author: Dimitrije Dobrota <mail@dimitrijedobrota.com>
Date:   Wed, 21 Sep 2022 23:49:50 +0200

get_queen_attacks() function

Diffstat:
Msrc/engine.c | 11+++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/engine.c b/src/engine.c @@ -586,6 +586,10 @@ static inline U64 get_rook_attacks(int square, U64 occupancy) { return rook_attacks[square][occupancy]; } +static inline U64 get_queen_attacks(int square, U64 occupancy) { + return (get_bishop_attacks(square, occupancy) | + get_rook_attacks(square, occupancy)); +} // magic numbers U64 generate_magic_number() { @@ -644,11 +648,10 @@ int main(void) { CBoard_T board; NEW(board); - CBoard_print(CBoard_fromFEN(board, empty_board)); - CBoard_print(CBoard_fromFEN(board, start_position)); - CBoard_print(CBoard_fromFEN(board, tricky_position)); - CBoard_print(CBoard_fromFEN(board, killer_position)); CBoard_print(CBoard_fromFEN(board, cmk_position)); + bitboard_print( + get_queen_attacks(d8, board->colorBB[WHITE] | board->colorBB[BLACK])); + FREE(board); return 0;