Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
skooter500 committed Mar 6, 2023
1 parent b67d58b commit 0106cae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions java/src/ie/tudublin/LifeBoard.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public int countCells(int row, int col)
{
for (int j = -1 ; j <= 1 ; j ++)
{
if (! (i == 0) && (j == 0))
if (! (i == 0 && j == 0))
{
if (getCell(i, j))
if (getCell(row + i, col + j))
{
count ++;
}
Expand All @@ -59,7 +59,6 @@ public void applyRules()
{
next[row][col] = false;
}

}
else
{
Expand All @@ -78,7 +77,8 @@ public void applyRules()
// dead with 3 neighboiurs comes to life
}
}
boolean[][] temp = board;
boolean[][] temp;
temp = board;
board = next;
next = temp;
}
Expand Down

0 comments on commit 0106cae

Please sign in to comment.