Skip to content

Instantly share code, notes, and snippets.

@zapthedingbat
Created November 3, 2020 11:56
Show Gist options
  • Save zapthedingbat/2e7d30bd548955381ed0b240b2fc1a52 to your computer and use it in GitHub Desktop.
Save zapthedingbat/2e7d30bd548955381ed0b240b2fc1a52 to your computer and use it in GitHub Desktop.
Parse morse code
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