public void TestRunProgramWithBitmaskFromFile() { PortComputer pc = new PortComputer(); pc.RunProgramWithBitmaskFromFile("input/day14.txt"); Assert.Equal(165, pc.SumOfMemory()); }
public void TestRunProgramWithDecoderFromFile() { PortComputer pc = new PortComputer(); pc.RunProgramWithDecoderFromFile("input/day14b.txt"); Assert.Equal(208, pc.SumOfMemory()); }
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); }
public void TestApplyMask(long value, string mask, long expected) { Assert.Equal(expected, PortComputer.ApplyMask(value, mask)); }