Created
November 3, 2020 11:56
-
-
Save zapthedingbat/2e7d30bd548955381ed0b240b2fc1a52 to your computer and use it in GitHub Desktop.
Parse morse code
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
process.argv | |
.slice(2) | |
.map(b => [...b].reduce((a, b) => 2 * a + +("." == b ? 1 : 2), 0)) | |
.map( | |
a => "-etianmsurwdkgohvf-l-pjbxcyzq--54-3---2--+----16=/-----7---8-90"[a] | |
) | |
.join("") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment