The program endlessly calculates the generations. It determines the new values for all squares, and then "copies" these values into the visible world:
for (y = 1; y < SIZE_Y-1; y++) {
for (x = 1; x < SIZE_X-1; x++) {
newCells[y][x] = newCellValue (y, x);
}
}
for (y = 1; y < SIZE_Y-1; y++) {
for (x = 1; x < SIZE_X-1; x++) {
cells[y][x] = newCells[y][x];
world.setLeaf (x, y, cells[y][x]);
}
}