Skip to content

Instantly share code, notes, and snippets.

Created November 25, 2015 03:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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