|
|
@ -26,12 +26,12 @@ public class Logic { |
|
|
|
return possibleFields.get(randy.nextInt(possibleFields.size())); |
|
|
|
} |
|
|
|
|
|
|
|
public ArrayList<Coordinate> getEverySecondField(Matchfield matchfield) { |
|
|
|
public ArrayList<Coordinate> getEverySecondField() { |
|
|
|
ArrayList<Coordinate> out = new ArrayList<Coordinate>(); |
|
|
|
for (int x = 0; x < Math.sqrt(matchfield.getSize()); x++) { |
|
|
|
for (int y = 0; y < Math.sqrt(matchfield.getSize()); y++) { |
|
|
|
for (int x = 0; x < Math.sqrt(this.matchfield.getSize()); x++) { |
|
|
|
for (int y = 0; y < Math.sqrt(this.matchfield.getSize()); y++) { |
|
|
|
if ((x % 2 == 0 && y % 2 == 0) || (x % 2 == 1 && y % 2 == 1)) { |
|
|
|
out.add(matchfield.getField(x, y)); |
|
|
|
out.add(this.matchfield.getField(x, y)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|