Guest User

Untitled

a guest
Dec 9th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. import Data.Char
  2.  
  3. caesar :: Char -> Int -> Char
  4. caesar letter num =
  5. case c > 122 of
  6. True -> chr $ c - 26
  7. False -> chr c
  8. where
  9. a = ord letter
  10. b = mod num 26
  11. c = a + b
  12.  
  13. uncaesar :: Char -> Int -> Char
  14. uncaesar letter num =
  15. case c < 97 of
  16. True -> chr $ c + 26
  17. False -> chr c
  18. where
  19. a = ord letter
  20. b = mod num 26
  21. c = a - b
Add Comment
Please, Sign In to add comment