28 lines
635 B
Java
28 lines
635 B
Java
public class Schachbrett {
|
|
//bauen eines schachbretts Feldname(0,0) -> "A1" TEST
|
|
private String[][] felder;
|
|
|
|
public Schachbrett() {
|
|
felder = new String[][] {{"A","B","C","D","E","F","G","H"},{"1","2","3","4","5","6","7","8"}};
|
|
|
|
}
|
|
|
|
public String feldname(int row, int col) {
|
|
String Ergebnis = felder[0][col] + felder[1][row];
|
|
//System.out.println("Die Position auf dem Schachbrett ist: " + Ergebnis);
|
|
return Ergebnis;
|
|
}
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
String ergebnis = new Schachbrett().feldname(0,0);
|
|
System.out.println("Die Position auf dem Schachbrett ist: " + ergebnis);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|