From e8ff9ed909d5b3853660c1e1f26140e7df0fc598 Mon Sep 17 00:00:00 2001 From: winapiadmin <138602885+winapiadmin@users.noreply.github.com> Date: Sun, 29 Mar 2026 23:37:14 +0700 Subject: [PATCH 1/5] Update doNullMove to handle en passant state --- position.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/position.h b/position.h index 932b795..77a6761 100644 --- a/position.h +++ b/position.h @@ -182,6 +182,9 @@ template Date: Sun, 29 Mar 2026 16:37:37 +0000 Subject: [PATCH 2/5] Apply clang-format --- position.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/position.h b/position.h index 77a6761..8d3bc85 100644 --- a/position.h +++ b/position.h @@ -182,9 +182,10 @@ template Date: Sun, 29 Mar 2026 23:37:57 +0700 Subject: [PATCH 3/5] Add tests for move, null move, and undo move --- tests.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests.cpp b/tests.cpp index 3c60bf0..22acd44 100644 --- a/tests.cpp +++ b/tests.cpp @@ -402,6 +402,17 @@ TEST_CASE("Experienced bugs in this repo") { REQUIRE(p.zobrist() == p.hash()); REQUIRE(p.hash() == 4177524090105507023); } + { + Position p; + p.doMove(Move(SQ_F7, SQ_F5)); + REQUIRE(p.zobrist() == p.hash()); + p.doNullMove(); + REQUIRE(p.zobrist() == p.hash()); + p.undoMove(); + REQUIRE(p.zobrist() == p.hash()); + p.undoMove(); + REQUIRE(p.zobrist() == p.hash()); + } { Position p; REQUIRE(p.getCastlingPath(WHITE, true) == 0x60); From b7545062d313ce4ffd4c4f24fbc53a644941ed58 Mon Sep 17 00:00:00 2001 From: winapiadmin <138602885+winapiadmin@users.noreply.github.com> Date: Sun, 29 Mar 2026 23:42:50 +0700 Subject: [PATCH 4/5] Update tests.cpp --- tests.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests.cpp b/tests.cpp index 22acd44..ee557da 100644 --- a/tests.cpp +++ b/tests.cpp @@ -404,6 +404,12 @@ TEST_CASE("Experienced bugs in this repo") { } { Position p; + p.doMove(Move(SQ_A2, SQ_A3)); + REQUIRE(p.zobrist() == p.hash()); + p.doMove(Move(SQ_B8, SQ_A6)); + REQUIRE(p.zobrist() == p.hash()); + p.doMove(Move(SQ_F2, SQ_F3)); + REQUIRE(p.zobrist() == p.hash()); p.doMove(Move(SQ_F7, SQ_F5)); REQUIRE(p.zobrist() == p.hash()); p.doNullMove(); @@ -412,6 +418,12 @@ TEST_CASE("Experienced bugs in this repo") { REQUIRE(p.zobrist() == p.hash()); p.undoMove(); REQUIRE(p.zobrist() == p.hash()); + p.undoMove(); + REQUIRE(p.zobrist() == p.hash()); + p.undoMove(); + REQUIRE(p.zobrist() == p.hash()); + p.undoMove(); + REQUIRE(p.zobrist() == p.hash()); } { Position p; From 0e69ea84d8d0d5ecec0cd7828d544197a60aa074 Mon Sep 17 00:00:00 2001 From: winapiadmin <138602885+winapiadmin@users.noreply.github.com> Date: Sun, 29 Mar 2026 16:54:13 +0000 Subject: [PATCH 5/5] fix 1 --- position.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/position.h b/position.h index 8d3bc85..3f6e036 100644 --- a/position.h +++ b/position.h @@ -182,6 +182,9 @@ template