Sicherung für Kord eingabe spielzug()
This commit is contained in:
Binary file not shown.
@@ -15,6 +15,16 @@ public class Spieler {
|
||||
{
|
||||
int pXKord = konsole.nextInt();
|
||||
int pYKord = konsole.nextInt();
|
||||
if(pYKord>3 || pXKord>3){
|
||||
System.out.println("Bitte gib Koordinaten von 1 bis 3 ein");
|
||||
int[]kords=spielzug();
|
||||
return kords;
|
||||
}
|
||||
if(pYKord<1 || pXKord<1){
|
||||
System.out.println("Bitte gib Koordinaten von 1 bis 3 ein");
|
||||
int[]kords=spielzug();
|
||||
return kords;
|
||||
}
|
||||
return new int[] {pXKord, pYKord};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user