Fix Scanner bug that would trigger a return keypress

This commit is contained in:
YannikG 2025-10-06 13:42:27 +02:00 committed by Yannik Giebenhain
parent 33f21ed65f
commit 39ce7daefd

View File

@ -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;
}