Morse decode by 51b

-module(m).
-export([m/0]).
m()->io:format(f(io:get_line(''),1)).
f([A|B],N)->if A rem$\x0f>1->[lists:nth(N rem$ ," etianmsurwdkgohvf,l.pjbxcyzq"),A|f(B,1)]--"/";0<1->f(B,2*N+A rem 2)end;f(L,_)->L.

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page