Exemple #1
0
        public void CanCalculateGridChecksum()
        {
            var input = @"
5 9 2 8
9 4 7 3
3 8 6 5
";
            EvenlyDivisibleGridChecksumCalculator checksumCalculator = new EvenlyDivisibleGridChecksumCalculator();
            int output = checksumCalculator.CalculateFor(input);

            Assert.Equal(9, output);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            DifferenceGridChecksumCalculator calculator = new DifferenceGridChecksumCalculator();
            var output = calculator.CalculateFor(code);

            EvenlyDivisibleGridChecksumCalculator evenlyDivisibleGridChecksumCalculator = new EvenlyDivisibleGridChecksumCalculator();
            var output2 = evenlyDivisibleGridChecksumCalculator.CalculateFor(code);

            Console.WriteLine($"checksum: {output}");
            Console.WriteLine($"checksum2: {output2}");
            Console.WriteLine("press to exit...");
            Console.ReadLine();
        }