Example #1
0
        private static string SolveGold(string input)
        {
            var keyPad = new KeyPad(5, 5, new []
            {
                ' ', ' ', '1', ' ', ' ',
                ' ', '2', '3', '4', ' ',
                '5', '6', '7', '8', '9',
                ' ', 'A', 'B', 'C', ' ',
                ' ', ' ', 'D', ' ', ' '
            });

            var code = Solve(keyPad, input);

            return($"Stupid keypad, but the code is: {code}");
        }
Example #2
0
        private static string Solve(KeyPad keyPad, string secretDocument)
        {
            var finger = new Finger(keyPad, secretDocument);

            return(string.Concat(finger.GetKeyPresses('5')));
        }
Example #3
0
 public Finger(KeyPad keyPad, string procedure)
 {
     _keyPad       = keyPad;
     _instructions = Memorize(procedure);
 }