bugfix: listMoves printed pseudo-legal moves | bench 4333527

This commit is contained in:
rektdie committed 2025-05-23 06:24:14 +02:00
1 parent 57ce93fe76
commit 43f9b1f988
1 file changed
+9 -1
+9 -1
View File
@@ -251,11 +251,19 @@ void Board::ResetMoves() {
} }
void Board::ListMoves() { void Board::ListMoves() {
int moveCount = 1;
for (int i = 0; i < currentMoveIndex; i++) { for (int i = 0; i < currentMoveIndex; i++) {
std::cout << i+1 << ". "; Board copy = *this;
bool isLegal = copy.MakeMove(moveList[i]);
if (!isLegal)
continue;
std::cout << moveCount << ". ";
moveList[i].PrintMove(); moveList[i].PrintMove();
std::cout << "( " << moveTypes[moveList[i].GetFlags()] << " )"; std::cout << "( " << moveTypes[moveList[i].GetFlags()] << " )";
std::cout << std::endl; std::cout << std::endl;
moveCount++;
} }
} }