Thursday, 30 May 2013

Morse code generator

In just one line Mr. Johan Roennblom created a morse code generator:
foreach c ask{Message:} [l: index? find{ etinamsdrgukwohblzfcpövxäqüyj}c while[l >= 2][prin pick{-.}odd? l l: l / 2]prin" "]print""


Example:
Message:Hello world
.... . .-.. .-.. --- .-- --- .-. .-.. -..

No comments:

Post a Comment