Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DameAlissa {
- public static void main (String[] args) {
- Out.print ("Wie gross soll das Spielfeld Dame sein? Für 8x8 gib 8, für 10x10 gib 10, für 12x12 gib 12 ein:");
- int n;
- n = In.readInt();
- while (n!=8 && n!=10 && n!=12){
- Out.println ("Die Eingabe ist leider ungültig. Bitte beachte dass wenn du ein Feld welches 8x8 gross sein soll eine 8 eingegeben werden sollte. Für 10x10 entsprechend 10 und für 12x12 eine 12. ");
- n = In.readInt();
- }
- Grid.create(n, n);
- for (int column = 0; column < n; column++){
- for (int row = 0; row < n; row++){
- if (((column + row) % 2 )== 0)
- Grid.paintFloor(row, column, Grid.YELLOW);
- }
- }
- for (int row = 0; row < 3; row++){
- for (int column = 0; column < n; column++){
- if (((column + row) % 2 )== 0)
- Grid.placeItem(row, column , 'o');
- }
- }
- for (int row = n-3; row < n; row++){
- for (int column = 0; column < n; column++){
- if (((column + row) % 2 )== 0)
- Grid.placeItem(row, column , '*');
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement