Sha256: 7b2ebb95831cfcf66363a9d2879d1e8a4201871983d6e90ea1a9ddf1b1ee9eb0

Contents?: true

Size: 349 Bytes

Versions: 363

Compression:

Stored size: 349 Bytes

Contents

(ns robot-name)

(def ^:private letters (map char (range 65 91)))
(defn- generate-name []
  (format "%s%03d" (apply str (repeatedly 2 #(rand-nth letters)))
          (rand-int 1000)))

(defn robot []
  (atom {:name (generate-name)}))

(defn robot-name [robot]
  (:name @robot))

(defn reset-name [robot]
  (swap! robot assoc :name (generate-name)))

Version data entries

363 entries across 363 versions & 1 rubygems

Version Path
trackler-2.2.1.98 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.97 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.96 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.95 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.94 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.93 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.92 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.91 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.90 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.89 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.88 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.87 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.86 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.85 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.84 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.83 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.82 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.81 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.80 tracks/clojure/exercises/robot-name/src/example.clj
trackler-2.2.1.79 tracks/clojure/exercises/robot-name/src/example.clj