コード例 #1
0
        public void TestRunProgramWithBitmaskFromFile()
        {
            PortComputer pc = new PortComputer();

            pc.RunProgramWithBitmaskFromFile("input/day14.txt");
            Assert.Equal(165, pc.SumOfMemory());
        }
コード例 #2
0
        public void TestRunProgramWithDecoderFromFile()
        {
            PortComputer pc = new PortComputer();

            pc.RunProgramWithDecoderFromFile("input/day14b.txt");
            Assert.Equal(208, pc.SumOfMemory());
        }
コード例 #3
0
        public override Day Run()
        {
            dayOfMonth = 14;
            stopwatch.Start();
            PortComputer pc = new PortComputer();

            pc.RunProgramWithBitmaskFromFile("input/day14.txt");
            answer_part1 = pc.SumOfMemory().ToString();
            pc           = new PortComputer();
            pc.RunProgramWithDecoderFromFile("input/day14.txt");
            answer_part2 = pc.SumOfMemory().ToString();
            return(this);
        }
コード例 #4
0
 public void TestApplyMask(long value, string mask, long expected)
 {
     Assert.Equal(expected, PortComputer.ApplyMask(value, mask));
 }