Exemple #1
0
        public string PartB()
        {
            string    filePath  = @"Seventeen\DaySeventeenInput.txt";
            Dimension dimension = new Dimension(filePath, true);

            dimension.Run(6);
            int activeCubes = dimension.CountActiveCubes();

            return(activeCubes.ToString());
        }
Exemple #2
0
        public void Dimension_Run()
        {
            string filePath = @"Seventeen\DaySeventeenTestInputA.txt";
            var    sut      = new Dimension(filePath, false);

            sut.Run(6);
            var result = sut.CountActiveCubes();

            Assert.Equal(112, result);
        }
Exemple #3
0
        public static long CountActiveCubes(List <string> input)
        {
            var dimension = new Dimension(input);

            Console.WriteLine("Input: ");
            dimension.PrintLayers();

            for (var i = 0; i < 6; i++)
            {
                Console.WriteLine($"Turn {i}: ");
                DoTheMagic(dimension);
                dimension.PrintLayers();

                Console.WriteLine();
                Console.WriteLine("-----------------------------");
                Console.WriteLine();
            }

            dimension.PrintLayers();
            return(dimension.CountActiveCubes());
        }