Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#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