Encoder decoder by 51b

-module(e).
-export([m/0]).
m()->S=io:get_line(''),T=io:get_chars('',9999),io:format(if"e"<S->e(T);0<1->d(T,lists:reverse(T),1005)end).
e([A,B|S])->[A|e(S)++[B]];e(S)->S.
d([A|_],_,0)->[A];d([A|S],[B|T],N)->[A,B|d(S,T,N-1)].

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

download

return to the top page