Exemplo n.º 1
0
    public Day20()
    {
        Part = 2;

        Key                   = InputLine.ToBitArray('#');
        Game                  = new GameOfLife(true);
        Game.Expanding        = true;
        Game.NeighborFunction = pos => pos.RectAround(1, 1);
        Game.UpdateFunction   = cell =>
        {
            var index = cell.Neighbors().BitsToInt();
            return(Key[index]);
        };
        var input = AllGroups[1].Select2D(c => c == '#').ToGrid();

        foreach (var(pos, value) in input)
        {
            Game[pos] = value;
        }
    }