上記表のとおり実装したところ、NextGenerationメソッド内部ですが、こんな感じになりました。 うん、LINQっぽい。 public static World NextGeneration(this World world) { var lifes = world.SelectMany(life => from x in Enumerable.Range(-1, 3) from y in Enumerable.Range(-1, 3) select new { X = life.X + x, Y = life.Y + y, Score = x == 0 && y == 0 ? 0.5 : 1 }) .GroupBy(s => new { s.X, s.Y }) .Select(g => new { X = g.Key.X, Y = g.Key.Y, Score = g.Sum(a
![LINQ で LifeGame](https://cdn-ak-scissors.b.st-hatena.com/image/square/1d50198234c0566353494caf5a4226425bea93e6/height=288;version=1;width=512/https%3A%2F%2Fyone64.wordpress.com%2Fwp-content%2Fuploads%2F2012%2F12%2Fimage_thumb.png)