public void TestPartA()
        {
            var sut    = new DayEight();
            var result = sut.PartA();

            Assert.Equal("4877", result);
        }
Exemple #2
0
        public void PartB_Actual()
        {
            var sut    = new DayEight();
            var result = sut.PartB();

            Assert.Equal("2096", result);
        }
        public void TestPartB()
        {
            var sut    = new DayEight();
            var result = sut.PartB();

            Assert.Equal("5471", result);
        }
Exemple #4
0
        static void Main(string[] args)
        {
            IProblemRunner runner = new DayEight();

            Console.WriteLine(runner.InvokeSilver());
            Console.WriteLine(runner.InvokeGold());
        }
Exemple #5
0
        public void PartA_Actual()
        {
            var sut    = new DayEight();
            var result = sut.PartA();

            Assert.Equal("1941", result);
        }
Exemple #6
0
        public void ProcessAndDetermineRoot_Sum()
        {
            var input  = "2 3 0 3 10 11 12 1 1 0 1 99 2 1 1 2";
            var sut    = new DayEight();
            var result = sut.ProcessAndDetermineRoot(input);

            Assert.Equal(138, result.Sum());
        }
Exemple #7
0
        public void TryProgramUntilReachBottomAndReturnAccumulator()
        {
            string filePath = @"Eight\DayEightTestInputA.txt";
            var    sut      = new DayEight();
            var    result   = sut.TryProgramUntilReachBottomAndReturnAccumulator(filePath);

            Assert.Equal(8, result);
        }
        public void TestFindLargestRegisterValue()
        {
            var path   = @"Eight\DayEightTestInput.txt";
            var sut    = new DayEight();
            var result = sut.FindLargestRegisterValue(path);

            Assert.Equal(1, result);
        }
        public void testWithActualPartA()
        {
            var sot    = new DayEight();
            var result = sot.CountNumberOfLitPixels();

            Assert.Equal(116, result);

            sot.PrintScreen(sot.partAScreen);
            // Result of the print screen was = UPOJFLBCEZ
            // Had to copy into a text editor to zoom and see better
        }
        public void testRect()
        {
            char[,] screen = { { '.', '.', '.', '.', '.', '.', '.' },
                               { '.', '.', '.', '.', '.', '.', '.' },
                               { '.', '.', '.', '.', '.', '.', '.' } };

            var input = "rect 3x2";
            var sot   = new DayEight();

            sot.Rect(input, screen);

            var litPixels = sot.CountLitPixelsOnScreen(screen);

            Assert.Equal(6, litPixels);
        }
Exemple #11
0
        public void Part2_CalculateResultForSimpleExample()
        {
            var input = new[]
            {
                "nop +0",
                "acc +1",
                "jmp +4",
                "acc +3",
                "jmp -3",
                "acc -99",
                "acc +1",
                "jmp -4",
                "acc +6"
            };

            DayEight.CalculateResultForPartTwo(input).Should().Be(8);
        }
        public void testRotateColumn()
        {
            char[,] screen = { { '.', '.', '.', '.', '.', '.', '.' },
                               { '.', '.', '*', '.', '.', '.', '.' },
                               { '.', '.', '*', '.', '.', '.', '.' } };

            var input = "rotate column x=2 by 1";
            var sot   = new DayEight();

            sot.RotateColumn(input, screen);

            Assert.Equal('*', screen[0, 2]);
            Assert.Equal('.', screen[1, 2]);
            Assert.Equal('*', screen[2, 2]);

            var litPixels = sot.CountLitPixelsOnScreen(screen);

            Assert.Equal(2, litPixels);
        }
        public void testRotateRow()
        {
            char[,] screen = { { '.', '.', '.', '.', '.', '.', '.' },
                               { '.', '.', '*', '.', '*', '*', '*' },
                               { '.', '.', '.', '.', '.', '.', '.' } };

            var input = "rotate row y=1 by 2";
            var sot   = new DayEight();

            sot.RotateRow(input, screen);

            Assert.Equal('*', screen[1, 0]);
            Assert.Equal('*', screen[1, 1]);
            Assert.Equal('.', screen[1, 2]);
            Assert.Equal('.', screen[1, 3]);
            Assert.Equal('*', screen[1, 4]);
            Assert.Equal('.', screen[1, 5]);
            Assert.Equal('*', screen[1, 6]);

            var litPixels = sot.CountLitPixelsOnScreen(screen);

            Assert.Equal(4, litPixels);
        }
        static void Main(string[] args)
        {
            var x = DayEight.PartTwo();

            Console.WriteLine(DayEight.PartTwo());
        }
        public void DayEightPartTwoReturnsCorrectly(string input, int expected)
        {
            var result = DayEight.PartTwo(input);

            Assert.AreEqual(expected, result);
        }
Exemple #16
0
        public void Part2_CalculateResult()
        {
            var input = File.ReadAllLines(@"Input/input8.txt");

            System.Console.WriteLine(DayEight.CalculateResultForPartTwo(input));
        }
Exemple #17
0
        private static void DayEightInput()
        {
            var file = File.ReadAllText("bin/Debug/netcoreapp2.0/Inputs/DayEight.txt");

            Console.WriteLine(DayEight.PartTwo(file));
        }