Fixed bugs.

deliverable_2
asdfasdf 6 years ago
parent d3f2297d27
commit 15f2aac1a8

@ -15,6 +15,7 @@ public class Main {
//options = new Options();
System.out.println("Welcome to " + PROGRAM_NAME + "!");
guess();
end();
}
// java main
@ -40,8 +41,16 @@ public class Main {
public int getUserInt() {
Scanner scan = new Scanner(System.in);
int result = scan.nextInt();
scan.close();
int result = 0;
while (true) {
if (scan.hasNextInt()) {
result = scan.nextInt();
break;
} else {
System.out.println("Try again?");
scan.nextLine();
}
}
return result;
}

Loading…
Cancel
Save