Exemplo n.º 1
0
 static void MorseString(string s)
 {
     foreach (var c in s)
     {
         MorseChar(MorseTable.GetMorseCode(c));
     }
 }
Exemplo n.º 2
0
        static void Morse(string str)
        {
            foreach (char c in str)
            {
                //Get the Morse code representation of the current character:
                string morseCode = MorseTable.GetMorseCode(c);

                if (morseCode == " ")
                {
                    Console.WriteLine("<Space>");
                }
                else
                {
                    Console.Write("{0}", morseCode);
                }

                Thread.Sleep(1000);

                foreach (char d in morseCode)
                {
                    switch (d)
                    {
                    case '.': Flash(100); break;

                    case '-': Flash(350); break;

                    case ' ': Flash(1000); break;
                    }
                }
            }
        }