Corrected the pawn logic as it was flawed.
This commit is contained in:
parent
73e0bc0106
commit
c363bf7c1b
|
|
@ -12,8 +12,8 @@ public class Pawn extends Piece {
|
|||
@Override
|
||||
public List<Move> getLegalMoves(Board board, int row, int col) {
|
||||
List<Move> moves = new ArrayList<>();
|
||||
int direction = isWhite ? -1 : 1; // White moves up, black down
|
||||
int startRow = isWhite ? 6 : 1;
|
||||
int direction = isWhite ? 1 : -1; // White moves up, black down
|
||||
int startRow = isWhite ? 1 : 6;
|
||||
|
||||
// Move forward
|
||||
int oneStep = row + direction;
|
||||
|
|
|
|||
Loading…
Reference in New Issue