Sicherung für Kord eingabe spielzug()
This commit is contained in:
parent
b32f3cc992
commit
0861237010
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};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue