コード例 #1
0
        public void SolvePuzzle()
        {
            string input = GetPuzzleInput();

            Assert.Equal(58975, CorruptionChecksum.getMinMaxAggregate(input));
            Assert.Equal(308, CorruptionChecksum.getDivisionAggregate(input));
        }
コード例 #2
0
        public void Example_Part2()
        {
            var input = "5\t9\t2\t8\r\n" +
                        "9\t4\t7\t3\r\n" +
                        "3\t8\t6\t5";

            CorruptionChecksum.CalculateCheckSum_Part2(input).Should().Be(9);
        }
コード例 #3
0
        public void Example()
        {
            var input = "5  1   9   5\r\n" +
                        "7  5   3\r\n" +
                        "2  4   6   8";

            CorruptionChecksum.CalculateCheckSum(input).Should().Be(18);
        }
コード例 #4
0
        public void PartTwo()
        {
            string input = @"
5 9 2 8
9 4 7 3
3 8 6 5
";

            Assert.Equal(9, CorruptionChecksum.getDivisionAggregate(input));
        }
コード例 #5
0
        public void PartOne()
        {
            string input = @"
5 1 9 5
7 5 3
2 4 6 8
";

            Assert.Equal(18, CorruptionChecksum.getMinMaxAggregate(input));
        }
コード例 #6
0
        static void Main(string[] args)
        {
            Console.WriteLine($"Day1 Answer: {InverseCaptcha.CalcSum()}");
            Console.WriteLine($"Day1 Part2 Answer: {InverseCaptcha.CalcSumPart2()}");

            var day2InputPuzzle = System.IO.File.ReadAllText("Day2\\InputPuzzleDay2.txt");

            Console.WriteLine($"Day2 Answer: {CorruptionChecksum.CalculateCheckSum(day2InputPuzzle)}");
            Console.WriteLine($"Day1 Part2 Answer: {CorruptionChecksum.CalculateCheckSum_Part2(day2InputPuzzle)}");

            Console.WriteLine($"Day3 Answer: {SpiralMemory.CalculateSteps(289326)}");


            if (Debugger.IsAttached)
            {
                Console.ReadKey();
            }
        }
コード例 #7
0
 public void Setup()
 {
     ClassUnderTest = new CorruptionChecksum();
 }