Skip to content

Instantly share code, notes, and snippets.

@danprince
Created September 2, 2013 18:11
Show Gist options
  • Save danprince/6415649 to your computer and use it in GitHub Desktop.
Save danprince/6415649 to your computer and use it in GitHub Desktop.
Morse Code
m=".-|-...|-.-.|-..|.|..-.|--.|....|..|.---|-.-|.-..|--|-.|---|.--.|--.-|.-.|...|-|..-|...-|.--|-..-|-.--|--..".split("|")
m[-33]=" "
t=function(s){
for(o="",i=0;i<s.length;o+=m[s.charCodeAt(++i)-65]){}
return o
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment