Skip to content

Instantly share code, notes, and snippets.

@mattbruv
Last active November 8, 2018 01:45
Show Gist options
  • Save mattbruv/7344876cca4c6d07a0533786723a7c74 to your computer and use it in GitHub Desktop.
Save mattbruv/7344876cca4c6d07a0533786723a7c74 to your computer and use it in GitHub Desktop.
import Data.List
import Data.Char
alphabet = ['a'..'z']
caesar = shiftRight 23 alphabet
shiftRight n xs = take (length xs) (drop n (cycle xs))
secret = map encrypt
encrypt letter = case (elemIndex (toLower letter) alphabet) of
Just n -> caesar !! n
Nothing -> letter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment