public void ShouldGetAllPotsWithPlantsAfter20YearsFromSimpleExample()
        {
            var input       = "#..#.#..##......###...###";
            var growthRules = new List <string>
            {
                "...## => #",
                "..#.. => #",
                ".#... => #",
                ".#.#. => #",
                ".#.## => #",
                ".##.. => #",
                ".#### => #",
                "#.#.# => #",
                "#.### => #",
                "##.#. => #",
                "##.## => #",
                "###.. => #",
                "###.# => #",
                "####. => #"
            };
            var sut = new PotTunnel(input, growthRules);

            sut.GetPotString(-3, 35).Should().Be("...#..#.#..##......###...###...........");

            sut.GrowNextGeneration();
            sut.GetPotString(-3, 35).Should().Be("...#...#....#.....#..#..#..#...........");

            sut.GrowUntilGeneration(13);
            sut.GetPotString(-3, 35).Should().Be("..#..###.#....#.#...#....#...#...#.....");

            sut.GrowUntilGeneration(20);
            sut.GetSumOfAllPotNumbersThatCountainPlantsInCurrentGeneration().Should().Be(325);
        }
        public void ShouldGetAllPotsWithPlantsAfter50BillionYearsFromBigInput()
        {
            var input       = "#.#.#...#..##..###.##.#...#.##.#....#..#.#....##.#.##...###.#...#######.....##.###.####.#....#.#..##";
            var growthRules = new List <string>
            {
                "#...# => #",
                "....# => .",
                "##..# => #",
                ".#.## => #",
                "##.## => .",
                "###.# => #",
                "..... => .",
                "...#. => .",
                ".#.#. => #",
                "#.##. => #",
                "..#.# => #",
                ".#... => #",
                "#.#.. => .",
                "##.#. => .",
                ".##.. => #",
                "#..#. => .",
                ".###. => .",
                "..#.. => .",
                "#.### => .",
                "..##. => .",
                ".#..# => #",
                ".##.# => .",
                ".#### => .",
                "...## => #",
                "#.#.# => #",
                "..### => .",
                "#..## => .",
                "####. => #",
                "##### => .",
                "###.. => #",
                "##... => #",
                "#.... => ."
            };
            var sut = new PotTunnel(input, growthRules);

            sut.GrowUntilGeneration(101);
            var sumAfter100Years = sut.GetSumOfAllPotNumbersThatCountainPlantsInCurrentGeneration();

            var remainingYears = 50000000000 - 101;

            var finalSum = sumAfter100Years + (remainingYears * 59);

            finalSum.Should().Be(2950000001598);
        }
        public void ShouldGetAllPotsWithPlantsAfter20YearsFromBigInput()
        {
            var input       = "#.#.#...#..##..###.##.#...#.##.#....#..#.#....##.#.##...###.#...#######.....##.###.####.#....#.#..##";
            var growthRules = new List <string>
            {
                "#...# => #",
                "....# => .",
                "##..# => #",
                ".#.## => #",
                "##.## => .",
                "###.# => #",
                "..... => .",
                "...#. => .",
                ".#.#. => #",
                "#.##. => #",
                "..#.# => #",
                ".#... => #",
                "#.#.. => .",
                "##.#. => .",
                ".##.. => #",
                "#..#. => .",
                ".###. => .",
                "..#.. => .",
                "#.### => .",
                "..##. => .",
                ".#..# => #",
                ".##.# => .",
                ".#### => .",
                "...## => #",
                "#.#.# => #",
                "..### => .",
                "#..## => .",
                "####. => #",
                "##### => .",
                "###.. => #",
                "##... => #",
                "#.... => ."
            };
            var sut = new PotTunnel(input, growthRules);

            sut.GrowUntilGeneration(20);
            sut.GetSumOfAllPotNumbersThatCountainPlantsInCurrentGeneration().Should().Be(3120);
        }