diff --git a/lib/functions/_partials/legal_moves_black.dart b/lib/functions/_partials/legal_moves_black.dart index 0a15e27..9be64d3 100644 --- a/lib/functions/_partials/legal_moves_black.dart +++ b/lib/functions/_partials/legal_moves_black.dart @@ -203,7 +203,7 @@ class _LegalMovesBlack { // up bool hasEncounteredPiece = false; int j = i-8; - while (!hasEncounteredPiece && j > 0) { + while (!hasEncounteredPiece && j >= 0) { if (Piece.emptySquare == position.board[j]) { yield ("${Position.squareIndexToString(i)}${Position.squareIndexToString(j)}", Position.from(position)..playMoveIndices(i, j)); } else { diff --git a/lib/functions/_partials/legal_moves_white.dart b/lib/functions/_partials/legal_moves_white.dart index 460cea4..11ece7b 100644 --- a/lib/functions/_partials/legal_moves_white.dart +++ b/lib/functions/_partials/legal_moves_white.dart @@ -203,7 +203,7 @@ class _LegalMovesWhite { // up bool hasEncounteredPiece = false; int j = i-8; - while (!hasEncounteredPiece && j > 0) { + while (!hasEncounteredPiece && j >= 0) { if (Piece.emptySquare == position.board[j]) { yield ("${Position.squareIndexToString(i)}${Position.squareIndexToString(j)}", Position.from(position)..playMoveIndices(i, j)); } else {