예제 #1
0
    int Iterate(string input, int iterations)
    {
        var mtx     = Mtx.FromString(".#./..#/###");
        var ruleset = new RuleSet(input);

        for (var i = 0; i < iterations; i++)
        {
            mtx = ruleset.Apply(mtx);
        }
        return(mtx.Count());
    }