Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String[] userInputCoords = new Scanner(System.in).nextLine().toUpperCase().split(" ");
- while (!userInputCoords[0].matches(ConstantsModel.COORDS_REGEX)
- && !userInputCoords[1].matches(ConstantsModel.COORDS_REGEX)) {
- System.out.println(ConstantsModel.TELL_ERROR);
- askCoords(ship.getName(), ship.getSize());
- serInputCoords = new Scanner(System.in).nextLine().toUpperCase().split(" ");
- }
- int[] parsedCoords = parseCoordsToArrayIndexes(userInputCoords);
- int[] fullShipCoords = extrapolateBodyCoords(parsedCoords, ship.getSize());
- CoordinateModel[] shipCoordinates = new CoordinateModel[fullShipCoords.length];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement