예제 #1
0
        public void Answer2()
        {
            var program = new BitProgram();

            program.Run(Input.GetLines(Properties.Resources.Day14Input), true);
            Assert.AreEqual(3926790061594L, program.SumVersion2());
        }
예제 #2
0
        [TestMethod] public void Answer1()
        {
            var program = new BitProgram();

            program.Run(Input.GetLines(Properties.Resources.Day14Input));
            Assert.AreEqual("15514035145260", program.Sum());
        }
예제 #3
0
        public void Test2()
        {
            var program = new BitProgram();

            program.Run(new string[]
            {
                "mask = 000000000000000000000000000000X1001X",
                "mem[42] = 100",
                "mask = 00000000000000000000000000000000X0XX",
                "mem[26] = 1"
            }, true);
            Assert.AreEqual(208L, program.SumVersion2());
        }
예제 #4
0
        public void Test1()
        {
            var program = new BitProgram();

            program.Run(new string[]
            {
                "mask = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X",
                "mem[8] = 11",
                "mem[7] = 101",
                "mem[8] = 0"
            });
            Assert.AreEqual("165", program.Sum());
        }