Пример #1
0
        protected override void SolvePartTwo()
        {
            SpringDroid springdroid = new SpringDroid(program, false);

            springdroid.AddInstruction("NOT A T");
            springdroid.AddInstruction("NOT B J");
            springdroid.AddInstruction("OR T J");
            springdroid.AddInstruction("NOT C T");
            springdroid.AddInstruction("OR T J");
            springdroid.AddInstruction("AND D J");
            springdroid.AddInstruction("NOT H T");
            springdroid.AddInstruction("AND E T");
            springdroid.AddInstruction("OR H T");
            springdroid.AddInstruction("AND T J");
            resultPartTwo = springdroid.Run().ToString();
        }
Пример #2
0
        protected override void SolvePartOne()
        {
            SpringDroid springdroid = new SpringDroid(program, false);

            //if any of ABC has a hole and D is safe, jump to D
            springdroid.AddInstruction("NOT A T");
            springdroid.AddInstruction("NOT B J");
            springdroid.AddInstruction("OR T J");
            springdroid.AddInstruction("NOT C T");
            springdroid.AddInstruction("OR T J");
            springdroid.AddInstruction("AND D J");
            resultPartOne = springdroid.Walk().ToString();
        }