Im having the problem, that a method isn't printing on its second (or more) call, despite working fine on the first time and I just can't see what's the problem.
public class Main {
public static void main(String[] args) {
Field playingField = new Field(5, 5);
playingField.fillField();
TransitionRules transitionRules = new TransitionRules();
playingField.printField();
transitionRules.fieldTransition(playingField);
System.out.println();
playingField.printField();
}
it is about the playingField.printField()-method, which I have implemented in a different class like this:
public class Field {
private int xSize;
private int ySize;
public ArrayList<Cell> field = new ArrayList<Cell>();
public void printField() {
for (int i = 0; i < this.ySize; i++) {
for (int j = 0; j < this.xSize; j++) {
System.out.print(this.field.get((i*10)+j).getState() + " ");
System.out.print(this.field.get((i*10)+j).getyCoordinate() + " ");
System.out.print(this.field.get((i*10)+j).getxCoordinate() + " ");
System.out.print((i*10)+j + " ");
}
System.out.println();
}
}
I already tried printing it twice, before applying the fieldTransition()-method, but it did not work, so that also isn't the problem.
Any help is much appreciated.
