Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.util.Random;
- public class Mal {
- public static void Eingabe(){
- Scanner sc= new Scanner(System.in);
- System.out.println("Bitte geben Sie die Erste Koordinate ein"); //Erste Zahl wird eingelesen
- int Zahl1 =Integer.parseInt(sc.next());
- System.out.println("Bitte geben Sie die Zweite Koordinate ein");
- int Zahl2 =Integer.parseInt(sc.next());
- }
- public static void feldBenutzer(){
- {char [][] feldBenutzer= new char [11][11];
- for (char i=0;i<feldBenutzer.length;i++) {
- for (char j=0;j<feldBenutzer.length;j++) {
- if (i==0 && j==0 ){
- System.out.print(" ");}
- else if (i==1 && j==0||i==0 &&j==1){
- System.out.print("|1");
- }
- else if (i==2 && j==0||i==0 &&j==2){
- System.out.print("|2");
- }
- else if (i==3 && j==0||i==0 &&j==3){
- System.out.print("|3");
- }
- else if (i==4 && j==0 || i==0 && j==4){
- System.out.print("|4");
- }
- else if (i==5 && j==0||i==0 &&j==5){
- System.out.print("|5");
- }
- else if (i==6 && j==0||i==0 &&j==6){
- System.out.print("|6");
- }
- else if (i==7 && j==0||i==0 &&j==7){
- System.out.print("|7");
- }
- else if (i==8 && j==0 || i==0 && j==8){
- System.out.print("|8");
- }
- else if (i==9 && j==0 || i==0 && j==9){
- System.out.print("|9");
- }
- else if (i==10 && j==0 || i==0 && j==10){
- System.out.print("10");}
- else {
- System.out.print("|@");}
- }
- System.out.println("|");
- }
- Eingabe();
- }
- }
- public static void main(String[]args){
- feldBenutzer();
- }}
Add Comment
Please, Sign In to add comment