-
-
Save dustinlacewell/97858ec608a9f6903d92593abd69bba5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
baseOrdinal :: Int | |
baseOrdinal = ord 'a' | |
reduceOrdinal :: Char -> Int | |
reduceOrdinal char = ord char - baseOrdinal | |
adjustOrdinal amount = (+ amount) . reduceOrdinal | |
moduloOrdinal amount = (`mod` 26) . adjustOrdinal amount |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment