Guest User

Untitled

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