Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Data.Char
- caesar :: Char -> Int -> Char
- caesar letter num =
- case c > 122 of
- True -> chr $ c - 26
- False -> chr c
- where
- a = ord letter
- b = mod num 26
- c = a + b
- uncaesar :: Char -> Int -> Char
- uncaesar letter num =
- case c < 97 of
- True -> chr $ c + 26
- False -> chr c
- where
- a = ord letter
- b = mod num 26
- c = a - b
Add Comment
Please, Sign In to add comment