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.139 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.138 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.137 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.136 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.135 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.134 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.133 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.132 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.131 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.130 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.129 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.128 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.127 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.126 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.125 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.124 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.123 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.122 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.121 tracks/clojure/exercises/proverb/src/example.clj
trackler-2.2.1.120 tracks/clojure/exercises/proverb/src/example.clj