Пример #1
0
        public void Example9() //part 2
        {
            InputFolder = InputFolder + @"day07\";
            var parser = new BagRegulationParser(InputFolder + "input_day07_02_000_00.txt", 2, 3);

            //var shiny_gold_list = parser.GetContents("shiny_gold");
            var level_2_list = parser.BuildAllTheContents("shiny_gold");

            var c = level_2_list.Count;
        }
Пример #2
0
        public void Part2()
        {
            InputFolder = InputFolder + @"day07\";
            var parser = new BagRegulationParser(InputFolder + "input_day07_01_00.txt", 2, 3);
            //the input file has been gently pre-processed:
            // original: shiny gold bags contain 2 dark red bags.
            // cooked: shiny_gold=dark_red|dark_red

            var target  = "shiny_gold";
            var bigList = parser.BuildAllTheContents(target); // a list of lists

            var actual = bigList.Count - 1;                   //why does this work?

            Console.WriteLine(actual);

            var expected = 11261;
        }