Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions com/laboon/Cell.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ public State iterate(int numNeighbors) {
public char getStateRep() {
char toReturn = ' ';
if (_state == State.DEAD) {
toReturn = '.';
toReturn = ' ';
} else if (_state == State.ALIVE) {
toReturn = 'X';
toReturn = '*';
} else {
toReturn = '?';
toReturn = ' ';
}
return toReturn;
}
Expand Down
8 changes: 4 additions & 4 deletions com/laboon/JavaLife.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ public class JavaLife {

/**
*
* @param size Size of world
* @param seed Random number seed
* @param size Size of a world
* @param seed Random number seed for RNG
* @param percent Percent of cells alive at beginning
* @param maxIterations Maximum number of iterations
*/

public JavaLife(int size, int seed, int percent, int maxIterations) {
World w = new World(size, seed, percent);
System.out.println("Initial Configuration:");
System.out.println(w.toString());
System.out.println( w.toString() );
for (int j=0; j < maxIterations; j++) {
w = w.iterate();
w = w.iterate();
System.out.println("Iteration " + (j + 1) + ":");
System.out.println(w.toString());
}
Expand Down