Пример #1
0
        public void AddCharacter(string input)
        {
            var splittedInput = input.Split(' ');
            var morse         = "";

            foreach (var splitInput in splittedInput)
            {
                if (splitInput == "dash" || splitInput == "dot" || splitInput == "next")
                {
                    morse += splitInput + " ";
                }
            }

            morse = morse.Trim();

            if (input.Contains("first"))
            {
                RecievedCharacter1      = InternalFunctions.GetLetterFromMorse(morse);
                RecievedCharacterValue1 = InternalFunctions.GetNumberFromLetter(RecievedCharacter1);
                return;
            }
            if (input.Contains("second"))
            {
                RecievedCharacter2      = InternalFunctions.GetLetterFromMorse(morse);
                RecievedCharacterValue2 = InternalFunctions.GetNumberFromLetter(RecievedCharacter2);
                return;
            }
            if (input.Contains("third"))
            {
                RecievedCharacter3      = InternalFunctions.GetLetterFromMorse(morse);
                RecievedCharacterValue3 = InternalFunctions.GetNumberFromLetter(RecievedCharacter3);
                return;
            }
            if (input.Contains("last"))
            {
                RecievedCharacter3      = InternalFunctions.GetLetterFromMorse(morse);
                RecievedCharacterValue3 = InternalFunctions.GetNumberFromLetter(RecievedCharacter3);
                return;
            }
        }
Пример #2
0
        public string GetFrequence()
        {
            var word = InternalFunctions.GetLetterFromMorse(Sequence1) + InternalFunctions.GetLetterFromMorse(Sequence2) + InternalFunctions.GetLetterFromMorse(Sequence3) + InternalFunctions.GetLetterFromMorse(Sequence4) + InternalFunctions.GetLetterFromMorse(Sequence5) + InternalFunctions.GetLetterFromMorse(Sequence6) + InternalFunctions.GetLetterFromMorse(Sequence1) + InternalFunctions.GetLetterFromMorse(Sequence2) + InternalFunctions.GetLetterFromMorse(Sequence3) + InternalFunctions.GetLetterFromMorse(Sequence4) + InternalFunctions.GetLetterFromMorse(Sequence5);

            if (word.Contains("shell"))
            {
                return("5 0 5");
            }
            if (word.Contains("halls"))
            {
                return("5 1 5");
            }
            if (word.Contains("slick"))
            {
                return("5 2 2");
            }
            if (word.Contains("trick"))
            {
                return("5 3 2");
            }
            if (word.Contains("boxes"))
            {
                return("5 3 5");
            }
            if (word.Contains("leaks"))
            {
                return("5 4 2");
            }
            if (word.Contains("strobe"))
            {
                return("5 4 5");
            }
            if (word.Contains("bistro"))
            {
                return("5 5 2");
            }
            if (word.Contains("flick"))
            {
                return("5 5 5");
            }
            if (word.Contains("bombs"))
            {
                return("5 6 5");
            }
            if (word.Contains("break"))
            {
                return("5 7 2");
            }
            if (word.Contains("brick"))
            {
                return("5 7 5");
            }
            if (word.Contains("steak"))
            {
                return("5 8 2");
            }
            if (word.Contains("sting"))
            {
                return("5 9 2");
            }
            if (word.Contains("vector"))
            {
                return("5 9 5");
            }
            if (word.Contains("beats"))
            {
                return("6 0 0");
            }
            return("");
        }