June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
7
Task/Caesar-cipher/Clojure/caesar-cipher-2.clj
Normal file
7
Task/Caesar-cipher/Clojure/caesar-cipher-2.clj
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
(defn encode [k s]
|
||||
(let [f #(take 26 (drop %3 (cycle (range (int %1) (inc (int %2))))))
|
||||
a #(map char (concat (f \a \z %) (f \A \Z %)))]
|
||||
(apply str (replace (zipmap (a 0) (a k)) s))))
|
||||
|
||||
(defn decode [k s]
|
||||
(encode (- 26 k) s))
|
||||
Loading…
Add table
Add a link
Reference in a new issue