fertiges Assignment
This commit is contained in:
parent
51054a0351
commit
995bf8fc61
@ -1,5 +1,4 @@
|
||||
public interface ILife {
|
||||
|
||||
// Methoden zum Setzen der Ausgangssituation
|
||||
public void nukeAll();
|
||||
public void setAlive(int x, int y);
|
||||
|
@ -63,6 +63,7 @@ public class Life implements ILife {
|
||||
return isInBounds(x, y) && grid[x][y];
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ILife nextGeneration() {
|
||||
Life newLife = new Life();
|
||||
|
@ -31,9 +31,7 @@ public class LifeTest {
|
||||
l.setAlive(1, 1);
|
||||
l.setAlive(1, 2);
|
||||
l.setAlive(2, 1);
|
||||
|
||||
ILife nextGen = l.nextGeneration();
|
||||
|
||||
assertTrue(nextGen.isAlive(1, 1));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user