tracks/clojure/exercises/robot-name/src/example.clj in trackler-2.0.3.7 vs tracks/clojure/exercises/robot-name/src/example.clj in trackler-2.0.3.8
- old
+ new
@@ -1,11 +1,10 @@
(ns robot-name)
-(def ^:private random (java.util.Random.))
(def ^:private letters (map char (range 65 91)))
(defn- generate-name []
- (str (apply str (take 2 (shuffle letters)))
- (+ 100 (.nextInt random 899))))
+ (format "%s%03d" (apply str (repeatedly 2 #(rand-nth letters)))
+ (rand-int 1000)))
(defn robot []
(atom {:name (generate-name)}))
(defn robot-name [robot]