aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2022-09-14 17:44:42 +0300
committereug-vs <eugene@eug-vs.xyz>2022-09-14 17:45:22 +0300
commit71f28db1b8e26377d56f0eb0aef01f6c6c3afbd0 (patch)
tree0e7ad0fd5a6e1c5df73c9d9b34e68d67d9a449d1 /src/main.c
parent1373e30387bf5e8e7858e10c9dee4413bf20d71c (diff)
downloadj1chess-71f28db1b8e26377d56f0eb0aef01f6c6c3afbd0.tar.gz
feat: implement bitscanAndReset
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files changed, 4 insertions, 0 deletions
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"); {