Last active
November 8, 2018 01:45
-
-
Save mattbruv/7344876cca4c6d07a0533786723a7c74 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
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