Beispiel #1
0
        public void Level2Test()
        {
            var day = new Day08();

            day.GetInput(file: "test.txt", pattern: "\r\n");
            day.Level2(day.Input).Should().Be("8");
        }
Beispiel #2
0
        public void LoopTest()
        {
            var day = new Day08();

            day.Input = day.GetInput(file: "test.txt", pattern: "\r\n");
            day.ParseOperations();
            long acc = 0;

            day.ItLooped(day.Instructions, ref acc).Should().BeFalse();
        }
Beispiel #3
0
        public void ChangeTest(int index, Operation operation, Operation changed, int argument)
        {
            var day = new Day08();

            day.Input = day.GetInput(file: "test.txt", pattern: "\r\n");
            day.ParseOperations();
            day.ChangeIt(day.Instructions, index);
            day.Instructions[index].operation.Should().Be(changed);
            day.Instructions[index].argument.Should().Be(argument);
            day.ChangeIt(day.Instructions, index);
            day.Instructions[index].operation.Should().Be(operation);
            day.Instructions[index].argument.Should().Be(argument);
        }
Beispiel #4
0
        internal static void Run()
        {
            Console.WriteLine("hello");
            var day = new Day08();

            // day.GetInput(file: "test.txt", pattern: "\n");
            day.GetInput();
            Console.WriteLine(day.Level1(day.Input));
            //  day.PostL1Answer();
            Thread.Sleep(60000);
            Console.WriteLine(day.Level2(day.Input));
            day.PostL2Answer();
        }