Guest User

Untitled

a guest
May 27th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. import Char
  2.  
  3. rot13 :: String -> String
  4. rot13 = map (chr . rot . ord)
  5. where
  6. rot o | o `inn` (65, 90) = shift 65 o
  7. rot o | o `inn` (97, 122) = shift 97 o
  8. rot o = o
  9. shift n o = ((o-n+13)`mod`26)+n
  10. i `inn` (x, y) = i >= x && i <= y
Add Comment
Please, Sign In to add comment