Implement Search

This commit is contained in:
2022-12-23 18:34:34 +01:00
parent bcf4d66c49
commit 87adca7e66
15 changed files with 337 additions and 66 deletions

View File

@@ -224,6 +224,18 @@ TEST_CASE_PSEUDO_MOVES("Pseudo-legal bishop moves, empty board", "[Bishop]") {
);
}
TEST_CASE_PSEUDO_MOVES("Pseudo-legal bishop moves, empty board side", "[Bishop]") {
testPseudoLegalMoves(
// https://lichess.org/editor/B7/8/8/8/8/8/8/8_w_-_-_0_1
"B7/8/8/8/8/8/8/8 w - - 0 1",
"a8",
{
"b7", "c6", "d5",
"e4", "f3", "g2", "h1"
}
);
}
TEST_CASE_PSEUDO_MOVES("Pseudo-legal bishop moves, captures", "[Bishop]") {
testPseudoLegalMoves(
// https://lichess.org/editor/8/8/1p3P2/8/3B4/8/8/8_w_-_-_0_1
@@ -252,6 +264,41 @@ TEST_CASE_PSEUDO_MOVES("Pseudo-legal rook moves, empty board", "[Rook]") {
);
}
TEST_CASE_PSEUDO_MOVES("Pseudo-legal rook moves, empty board side", "[Rook]") {
testPseudoLegalMoves(
// https://lichess.org/editor/3R4/8/8/8/8/8/8/8_w_-_-_0_1
"3R4/8/8/8/8/8/8/8 w - - 0 1",
"d8",
{
"d1", "d2", "d3", "d4", "d5", "d6", "d7",
"a8", "b8", "c8",
"e8", "f8", "g8",
"h8"
}
);
}
TEST_CASE_PSEUDO_MOVES("legal rook moves, king check", "[Rook]") {
testPseudoLegalMoves(
// https://lichess.org/editor/5R1k/6pp/8/8/8/8/8/K7_b_-_-_0_1
"5R1k/6pp/8/8/8/8/8/K7 b - - 0 1",
"g7",
{}
);
}
TEST_CASE_PSEUDO_MOVES("legal king moves, king stale", "[Rook]") {
testPseudoLegalMoves(
// https://lichess.org/editor/k7/8/8/6n1/r7/4K3/2q5/8_w_-_-_0_1
"k7/8/8/6n1/r7/4K3/2q5/8 w - - 0 1",
"e3",
{}
);
}
TEST_CASE_PSEUDO_MOVES("Pseudo-legal rook moves, captures", "[Rook]") {
testPseudoLegalMoves(
// https://lichess.org/editor/8/8/3p4/8/3R1P2/8/8/8_w_-_-_0_1