Skip to content

Instantly share code, notes, and snippets.

@coolbutuseless
Created July 20, 2018 10:01
Show Gist options
  • Save coolbutuseless/132779e4e993cf0ba7679a8f7887ec91 to your computer and use it in GitHub Desktop.
Save coolbutuseless/132779e4e993cf0ba7679a8f7887ec91 to your computer and use it in GitHub Desktop.
morse code tweet
#rstats #morse #sos
library(purrr);
s=strsplit;
flatten(map(s('sos','')[[1]],~set_names(s(s('._ _... _._. _.. . .._. __. .... .. .___ _._ ._.. __ _. ___ .__. __._ ._. ... _ .._ ..._ .__ _.._ _.__ __..',' ')[[1]],''),letters)[[.x]]))%>%walk(~{beepr::beep((.x=='_')+1);Sys.sleep(.5)})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment