Пример #1
0
        static void Main(string[] args)
        {
            var nd = new NextDigitSelectionAlgorithm();
            var hd = new HalfwayDigitSelectionAlgorithm();

            string puzzleInput = File.ReadAllText(@"..\..\..\PuzzleInput.txt");

            Console.WriteLine("Next digit algorithm");
            Console.WriteLine(nd.CalcCaptchaSum(puzzleInput));
            Console.WriteLine("--------------------------------");
            Console.WriteLine("Halfway digit algorithm");
            Console.WriteLine(hd.CalcCaptchaSum(puzzleInput));
            Console.ReadLine();
        }
Пример #2
0
        public void NextDigitAlg_NullOrEmpty_Zero()
        {
            var sum = alg.CalcCaptchaSum(null);

            Assert.AreEqual(0, sum);

            var sum2 = alg.CalcCaptchaSum("");

            Assert.AreEqual(0, sum2);
        }