Sha256: edd447a85c374673969bdd32ef442bf61ee0647d4cfc68c8fda99a2c4a0b1f4a

Contents?: true

Size: 485 Bytes

Versions: 104

Compression:

Stored size: 485 Bytes

Contents

(ns proverb
  (:require [clojure.string :as str]))

(def subjects ["nail" "shoe" "horse" "rider" "message" "battle" "kingdom"])

(def last-line "And all for the want of a horseshoe nail.")

(defn- line [[cause-subject effect-subject]]
  (format "For want of a %s the %s was lost." cause-subject effect-subject))

(def proverb (->> subjects
                  (partition 2 1)
                  (map line)
                  (#(conj (vec %) last-line))
                  (str/join "\n")))

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.179 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.178 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.177 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.176 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.175 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.174 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.173 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.172 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.171 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.170 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.169 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.167 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.166 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.165 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.164 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.163 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.162 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.161 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.160 tracks/clojure/exercises/proverb/src/example.clj