diff --git a/out/production/GameOfLifeAssignment/Life.class b/out/production/GameOfLifeAssignment/Life.class index f4fc0aa..af39a98 100644 Binary files a/out/production/GameOfLifeAssignment/Life.class and b/out/production/GameOfLifeAssignment/Life.class differ diff --git a/out/test/GameOfLifeAssignment/LifeTest.class b/out/test/GameOfLifeAssignment/LifeTest.class index bb3fd18..3e063b3 100644 Binary files a/out/test/GameOfLifeAssignment/LifeTest.class and b/out/test/GameOfLifeAssignment/LifeTest.class differ diff --git a/src/Life.java b/src/Life.java index 7048091..3276e7f 100644 --- a/src/Life.java +++ b/src/Life.java @@ -1,5 +1,6 @@ public class Life implements ILife { + private boolean[][] grid = new boolean[5][5]; // vorläufig 5x5 Raster public static void main(String[] args) { Life l = new Life(new String[] { " ", @@ -32,7 +33,7 @@ public class Life implements ILife { @Override public void setAlive(int x, int y) { - // TODO Auto-generated method stub + grid[x][y] = true; // damit Test grün wird, muss Zelle im grid true (alive) werden } @Override @@ -43,12 +44,18 @@ public class Life implements ILife { @Override public boolean isAlive(int x, int y) { - return true; + // REFACTORING: return nicht mehr einfach auf 'true' setzen, sondern tatsächlich eine Überprüfung ausführen + + // Zustand der Zelle an Position (x, y) + return grid[x][y]; + + // -> grid muss erstellt werden, siehe Zeile 3 } @Override public ILife nextGeneration() { Life next = new Life(); + next.setAlive(1,1); // muss jetzt ausgelöst werden, damit Zelle alive wird return next; } } \ No newline at end of file