I have following code:
`
public class HumanPlayer implements Player {
private final PrintStream out;
private final Scanner in;
public HumanPlayer(final PrintStream out, final Scanner in) {
this.out = out;
this.in = in;
}
public HumanPlayer() {
this(System.out, new Scanner(System.in));
}
@Override
public Move move(final Position position, final Cell cell) {
while (true) {
out.println("Position");
out.println(position);
out.println(cell + "'s move");
out.println("Enter row and column");
final Move move = new Move(in.nextInt(), in.nextInt(), cell);
if (position.isValid(move)) {
return move;
}
final int row = move.getRow();
final int column = move.getColumn();
out.println("Move " + move + " is invalid");
}
}
} `
Is there any way to let user correct their input? (for example, he will have the opportunity to input values again if he accidentaly wrote "hello world" instead of numbers)
