Beispiel #1
0
        private static void Day4()
        {
            int sumOfSectorIds = 0;
            var reader         = new StreamReader(@"..\..\Day4\input.txt");

            Day4.Day4 d4p1;

            while (!reader.EndOfStream)
            {
                var line = reader.ReadLine();

                d4p1 = new Day4.Day4(line);

                if (d4p1.IsRealRoom())
                {
                    sumOfSectorIds += d4p1.GetSectorId();
                }

                if (d4p1.Decrypt().StartsWith("north"))
                {
                    Console.WriteLine($"{d4p1.Decrypt()} -> {d4p1.GetSectorId()}");
                }
            }

            Console.WriteLine($"Puzzle 1: {sumOfSectorIds}");
        }
Beispiel #2
0
        public void IsRealRoomReturnsCorrectValue(string name, bool expected)
        {
            var sut = new AdventOfCode2016.Day4.Day4(name);

            var actual = sut.IsRealRoom();

            Assert.Equal(expected, actual);
        }