Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int IsShort;
- if(num1 < num2) {
- IsShort = num1;
- } else {
- IsShort = num2;
- }
- while (checkMarks < 3 || checkMarks > IsShort) {
- try {
- checkMarks = Integer.parseInt(input.nextLine().trim());
- } catch (NumberFormatException e) {
- System.out.println("Try again! It needs to be a number! 3 is the minimum and maximum is the amount of smaller side of board. " + "Height is: " + gameboardHeight +"." + " Width is: " + gameboardWidth + ".");
- continue;
- }
- if (checkMarks < 3 || checkMarks > IsShort) {
- System.out.println("Please give bigger number, 3 is the minimum and maximum is the amount of smaller side of board. " + "Height is: " + gameboardHeight +"." + " Width is: " + gameboardWidth + ".");
- }
- }
- return checkMarks;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement