Created
October 13, 2014 13:16
-
-
Save edvardm/20b76086ed27c4b19f45 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
rot13 = map (rot13' pairs) where | |
pairs = (zip s1 s2) ++ (zip s2 s1) | |
s1 = ['a'..'m'] ++ ['A'..'M'] ++ ['0'..'4'] | |
s2 = ['n'..'z'] ++ ['N'..'Z'] ++ ['5'..'9'] | |
rot13' [] ch = c | |
rot13' ((p,q):cs) c = if c == p then q else (rot13' cs c) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment