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` (78, 90)) || (o `inn` (110, 122)) = o - 13
- rot o | o `inn` (65, 77) || o `inn` ( 97, 109) = o + 13
- rot o = o
- i `inn` (x, y) = i >= x && i <= y
Add Comment
Please, Sign In to add comment