Advertisement
Guest User

Untitled

a guest
Dec 11th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. int IsShort;
  2.  
  3. if(num1 < num2) {
  4. IsShort = num1;
  5. } else {
  6. IsShort = num2;
  7. }
  8.  
  9. while (checkMarks < 3 || checkMarks > IsShort) {
  10.  
  11. try {
  12. checkMarks = Integer.parseInt(input.nextLine().trim());
  13. } catch (NumberFormatException e) {
  14. 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 + ".");
  15. continue;
  16. }
  17.  
  18. if (checkMarks < 3 || checkMarks > IsShort) {
  19. 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 + ".");
  20. }
  21. }
  22.  
  23. return checkMarks;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement