Unmix Screencast
tl;dr A simpler problem begets a shorter screencast.
I recorded another screencast.
It’s a different coding problem from the same newsletter as the last one. It was a simpler problem, and thus went much, much faster. (It’s still not very good, mind you, but it’s a learning process.)
And here’s the code:
src/pf/unmix.clj
(ns pf.unmix)
(defn unmix [s]
(->> s
(partition-all 2)
(map reverse)
(apply concat)
(apply str)))
(comment
(unmix "aHpp yeN weYra !eS eoy uni2 20 0):"))
test/pf/unmix_test.clj
(ns pf.unmix-test
(:require [clojure.test :refer :all]
[pf.unmix :refer [unmix]]))
(deftest unmix-test
(are [x y] (= x (unmix y))
"Hello" "eHllo"
"Clojure" "lCjorue"))
Questions? Comments? Contact me!
Tools Used
- Clojure
- 1.10.1
- Cursive
- 1.9.0-2019.3
- IntelliJ IDEA
- 2019.3 (Community Edition)