From 71f28db1b8e26377d56f0eb0aef01f6c6c3afbd0 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Wed, 14 Sep 2022 17:44:42 +0300 Subject: feat: implement bitscanAndReset --- src/main.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 2bd9583..0272073 100644 --- a/src/main.c +++ b/src/main.c @@ -5,6 +5,10 @@ int main() { start_test_section("Bitboards"); { unit_test(pop_count(0b01110) == 3, "Pop count of 01110 is 3"); + + Bitboard bb = 0b1100; + unit_test(bitscanAndReset(&bb) == 2, "Bitscan of 0b1100 is 2"); + unit_test(bb == 0b1000, "After bitscan with reset the LS1B is flipped"); } start_test_section("Default FEN string"); { -- cgit v1.2.3