Ejemplo n.º 1
0
        public void Example66() //actual example test
        {
            var parser = new BagRegulationParser(InputFolder + "input_day07_00.txt", 2);

            var boiled = parser.BoilRules(parser.rules);

            var boilingTimes = 2;

            for (int i = 0; i < boilingTimes; i++)
            {
                boiled = parser.BoilRules(boiled);
            }

            var target = "shiny gold";

            var actual   = parser.CountOuterBags(boiled, target);
            var expected = 4;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void Example7() //actual example test
        {
            var parser = new BagRegulationParser(InputFolder + "input_day07_00.txt");

            var boiled = parser.BoilRules(parser.rules);

            var oldBoiledCount = 0;

            do
            {
                oldBoiledCount = boiled.Count;
                boiled         = parser.BoilRules(boiled);
            } while (boiled.Count != oldBoiledCount);

            var target = "shiny gold";

            var actual   = parser.CountOuterBags(boiled, target);
            var expected = 4;

            Console.WriteLine($"{boiled.Count}");

            Assert.AreEqual(expected, actual);
        }