|
@@ -81,10 +81,7 @@ public class ConwayGameOfLife {
|
81
|
81
|
int count = neighbors(row, col, world);
|
82
|
82
|
int returnValue = 0;
|
83
|
83
|
|
84
|
|
- if (count == 3) {
|
85
|
|
- returnValue = 1;
|
86
|
|
- }
|
87
|
|
- if (world[row][col] == 1 && count == 2){
|
|
84
|
+ if (count == 3 || (world[row][col] == 1 && count == 2)) {
|
88
|
85
|
returnValue = 1;
|
89
|
86
|
}
|
90
|
87
|
|
|
@@ -111,7 +108,7 @@ public class ConwayGameOfLife {
|
111
|
108
|
j = 0;
|
112
|
109
|
}
|
113
|
110
|
|
114
|
|
- if (world[i][j] == 1 &&(!(i == row && j == col))) {
|
|
111
|
+ if (world[i][j] == 1 && (!(i == row && j == col))) {
|
115
|
112
|
count++;
|
116
|
113
|
}
|
117
|
114
|
|