Created
November 10, 2014 03:01
-
-
Save tmcw/6b1434fc52ca05c085dc to your computer and use it in GitHub Desktop.
Gist from mistakes.io
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
letters = ['.-', '-...', '-.-.', '-..', | |
'.', '..-.', '--.', '....', | |
'..', '.---', '-.-', '.-..', | |
'--', '-.', '---', '.--.', | |
'--.-', '.-.', '...', '-', | |
'..-', '...-', '.--', '-..-', '-.--', '--..'] | |
.reduce(function(memo, l, i) { | |
memo[l] = String.fromCharCode(97 + i); | |
return memo; | |
}, {}); | |
'-.-- --- ..-\ | |
/..- -. -.. . .-. ... - .- -. -../ \ | |
-- --- .-. ... ./\ | |
-.-. --- -.. . .-.-.-' | |
.split('/') | |
.map(function(s) { | |
return s.split(' ').map(function(s) { | |
return letters[s]; | |
}).join(''); | |
}).join(' '); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment