Browse Source

Add exit to end mid-game

AIPlayer
FelixKrull 2 years ago
parent
commit
d2d5cfc135
  1. 3
      src/main/java/Player.java

3
src/main/java/Player.java

@ -63,6 +63,9 @@ public class Player {
System.out.print("Wählen Sie eine Figur " + out + ": ");
try{
int input = scanner.nextInt();
if(input == -1) {
System.exit(0);
}
if (input > Collections.max(usableFigures) + 1 || input < Collections.min(usableFigures) + 1) {
System.out.println("Die eingegebene Zahl war zu groß oder zu klein.\n" +
"Bitte nur Zahlen von " + (Collections.min(usableFigures) + 1) + " bis " + (Collections.max(usableFigures) + 1) + " eingeben.");

Loading…
Cancel
Save