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