Fix Scanner bug that would trigger a return keypress
This commit is contained in:
parent
33f21ed65f
commit
39ce7daefd
@ -105,7 +105,7 @@ public class Main {
|
|||||||
while (choice == 0) {
|
while (choice == 0) {
|
||||||
System.out.print("> ");
|
System.out.print("> ");
|
||||||
if (scanner.hasNextInt()) {
|
if (scanner.hasNextInt()) {
|
||||||
choice = scanner.nextInt();
|
choice = Integer.parseInt(scanner.nextLine());
|
||||||
if (choice < 0 || choice > decisions.size()) {
|
if (choice < 0 || choice > decisions.size()) {
|
||||||
choice = 0;
|
choice = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user