bugfix: listMoves printed pseudo-legal moves | bench 4333527
This commit is contained in:
1 parent
57ce93fe76
commit
43f9b1f988
1 file changed
+9
-1
+9
-1
@@ -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++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user