stellar

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

commit46627ec50fac592cee9d8616f40d1d5e364d1f23
parent733fd2ea50dfbd88f6d14dea714bd8a9334998f1
authorDimitrije Dobrota <mail@dimitrijedobrota.com>
dateSat, 24 Sep 2022 13:25:48 +0200

Generate all other moves

Diffstat:
Msrc/engine.c|+++++++++++++----

1 files changed, 13 insertions(+), 4 deletions(-)


diff --git a/src/engine.c b/src/engine.c

@@ -258,10 +258,19 @@ void CBoard_move_generate(CBoard_T self) {

while (bitboard) {
source = bit_lsb_index(bitboard);
bit_pop(bitboard, source);
attack = Piece->attacks(source, occupancy) &
(C64(-1) ^ self->colorBB[color]);
printf("%s: %s; moves: %d\n", Piece->unicode,
square_to_coordinates[source], bit_count(attack));
attack = Piece->attacks(source, occupancy) & ~self->colorBB[color];
while (attack) {
target = bit_lsb_index(attack);
if (bit_get(self->colorBB[!color], target))
printf("%s from %s capture to %s\n", Piece->unicode,
square_to_coordinates[source],
square_to_coordinates[target]);
else
printf("%s from %s move %s\n", Piece->unicode,
square_to_coordinates[source],
square_to_coordinates[target]);
bit_pop(attack, target);
}
}
}
}