Created
November 25, 2015 03:37
-
-
Save mpahrens/9262c76aa5388834a0d9 to your computer and use it in GitHub Desktop.
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
#Matthew Ahrens: Nov 24th, 2015 | |
#sets up a lambda to take the split arguments: n is the num of the shift, m is the message | |
# reads the codepoints from the binary representation of the message, returns 32 (\space) if space, and shifts (looping around) otherise | |
#uses IO.gets |> String.split(",") as an argument to the lambda | |
# 132 characters | |
fn[n,m]->for<<x<-m>>,into: "",do: <<(if x<?a,do: 32,else: rem(x+String.to_integer(n)-?a,26)+?a)>>end.(String.split IO.gets(""),",") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment