Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Char
- rot13 :: String -> String
- rot13 = map (chr . rot . ord)
- where
- rot o | o `inn` (65, 90) = shift 65 o
- rot o | o `inn` (97, 122) = shift 97 o
- rot o = o
- shift n o = ((o-n+13)`mod`26)+n
- i `inn` (x, y) = i >= x && i <= y
Add Comment
Please, Sign In to add comment