Пример #1
0
        public override string SecondStar()
        {
            var input  = ReadLineInput();
            var result = RoomEncryptor.SectorOf(RoomEncryptor.Decrypt(input));

            return(result);
        }
Пример #2
0
        public override string FirstStar()
        {
            var input  = ReadLineInput();
            var result = RoomEncryptor.CountCorrectRoomDescriptors(input);

            return(result.ToString());
        }
Пример #3
0
        public void SecondStarExample()
        {
            var encrypted = "qzmt-zixmtkozy-ivhz-343";

            var decrypted = RoomEncryptor.Decrypt(encrypted);

            Assert.Equal("very-encrypted-name-343", decrypted);
        }
Пример #4
0
        public void FirstStarExample()
        {
            var count = RoomEncryptor.CountCorrectRoomDescriptors(new[]
            {
                "aaaaa-bbb-z-y-x-123[abxyz]",
                "a-b-c-d-e-f-g-h-987[abcde]",
                "not-a-real-room-404[oarel]",
                "totally-real-room-200[decoy]",
            });

            Assert.Equal(123 + 987 + 404, count);
        }