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