示例#1
0
    public long part_two(string input)
    {
        var simulation = new GameOfLife(input.CharPixels().Grid(ch => ch == '#'));

        simulation.AddRange(new[] { Point.O, new Point(0, 99), new Point(99, 0), new Point(99, 99) });
        for (var step = 1; step <= 100; step++)
        {
            simulation.NextGeneration();
            simulation.AddRange(new[] { Point.O, new Point(0, 99), new Point(99, 0), new Point(99, 99) });
        }
        return(simulation.Count);
    }