Created
August 22, 2016 18:59
-
-
Save xtrntr/7ce802882c097cdbe2f671656d97011a 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
(defn char-to-index [c] (- (int c) 97)) | |
(defn index-to-char [n] (char (+ n 97))) | |
(defn cesar [n] #(char (mod (- (char-index %) n) 26))) | |
(transduce (map (cesar 10)) str "abc") | |
;; common reducing functions: | |
;; str, conj, +, cons, into |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment