Skip to content

Commit 027a9a6

Browse files
authored
Merge pull request #14 from m1anas/patch-1
Corrected a typo.
2 parents 5d0627a + 4feb9e7 commit 027a9a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gameoflife/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class Main extends React.Component {
188188
if (j > 0) if (g[i][j - 1]) count++;
189189
if (i < this.rows - 1) if (g[i + 1][j]) count++;
190190
if (i < this.rows - 1 && j > 0) if (g[i + 1][j - 1]) count++;
191-
if (i < this.rows - 1 && this.cols - 1) if (g[i + 1][j + 1]) count++;
191+
if (i < this.rows - 1 && j < this.cols - 1) if (g[i + 1][j + 1]) count++;
192192
if (g[i][j] && (count < 2 || count > 3)) g2[i][j] = false;
193193
if (!g[i][j] && count === 3) g2[i][j] = true;
194194
}

0 commit comments

Comments
 (0)