Guest User

Untitled

a guest
Jun 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.util.Random;
  3.  
  4. public class Mal {
  5.  
  6. char [][] feldBenutzer= new char [11][11];
  7.  
  8. public static void Eingabe(){
  9. Scanner sc= new Scanner(System.in);
  10. System.out.println("Bitte geben Sie die Erste Koordinate ein"); //Erste Zahl wird eingelesen
  11. int Zahl1 =Integer.parseInt(sc.next());
  12. System.out.println("Bitte geben Sie die Zweite Koordinate ein");
  13. int Zahl2 =Integer.parseInt(sc.next());
  14. }
  15.  
  16.  
  17.  
  18. public static void feldBenutzer(){
  19. {char [][] feldBenutzer= new char [11][11];
  20. for (char i=0;i<feldBenutzer.length;i++) {
  21. for (char j=0;j<feldBenutzer.length;j++) {
  22. if (i==0 && j==0 ){
  23. System.out.print(" ");}
  24. else if (i==1 && j==0||i==0 &&j==1){
  25. System.out.print("|1");
  26. }
  27. else if (i==2 && j==0||i==0 &&j==2){
  28. System.out.print("|2");
  29. }
  30. else if (i==3 && j==0||i==0 &&j==3){
  31. System.out.print("|3");
  32. }
  33. else if (i==4 && j==0 || i==0 && j==4){
  34. System.out.print("|4");
  35. }
  36. else if (i==5 && j==0||i==0 &&j==5){
  37. System.out.print("|5");
  38. }
  39. else if (i==6 && j==0||i==0 &&j==6){
  40. System.out.print("|6");
  41. }
  42. else if (i==7 && j==0||i==0 &&j==7){
  43. System.out.print("|7");
  44. }
  45. else if (i==8 && j==0 || i==0 && j==8){
  46. System.out.print("|8");
  47. }
  48. else if (i==9 && j==0 || i==0 && j==9){
  49. System.out.print("|9");
  50. }
  51. else if (i==10 && j==0 || i==0 && j==10){
  52. System.out.print("10");}
  53. else {
  54. System.out.print("|@");}
  55. }
  56. System.out.println("|");
  57. }
  58. Eingabe();
  59.  
  60. }
  61.  
  62. }
  63. public static void main(String[]args){
  64. feldBenutzer();
  65. }}
Add Comment
Please, Sign In to add comment