in localized/ja/11-Other/GameOfLife/Program.cs [84:120]
static void Update()
{
int n;
for (int x = 0; x < WIDTH; x++)
{
for (int y = 0; y < HEIGHT; y++)
{
n = CountNeighbours(x, y);
if (n < 2)
{
// Die due to isolation
nextLife[x, y] = (byte) (currentLife[x, y] == 1 ? 2 : 0);
}
else if (n == 2)
{
// 2 neighbours - stable
nextLife[x, y] = currentLife[x, y];
}
else if (n == 3)
{
// 3 neighbours - new life (or same old life)
nextLife[x, y] = 1;
}
else
{
// 4 or more - die due to overcrowding
nextLife[x, y] = 0;
}
}
}
// Copy new Life to the matrix
Array.Copy(nextLife, currentLife, WIDTH*HEIGHT);
RedrawLife();
}