Morse code translator Write the shortest program to transform the standard input into Morse code. Characters not in the table should be printed as they are.
C# (213 characters)

I'm sure this wont stand long, but at least I got the technique here first!

class P{static void Main(string[] a){foreach(var t in a[0]){var c="";for(int i=" ETIANMSURWDKGOHVF L PJBXCYZQ  54 3   2       16       7   8 90".IndexOf(t);i&gt;0;i/=2)c="-."[i--%2]+c;System.Console.Write(c+"  ");}}}


And in readable format:

class P
{
    static void Main(string[] a)
    {   
        foreach(var t in a[0])
        {
            var c="";
            for(int i=" ETIANMSURWDKGOHVF L PJBXCYZQ  54 3   2       16       7   8 90".IndexOf(t);i&gt;0;i/=2)c="-."[i--%2]+c;
            System.Console.Write(c+" ");
        }
    }
}


For a brief explanation, the string of characters is a heap in which the left child is a dot and the right child is a dash.  To build the letter, you traverse back up and reverse the order.