Skip to content

Instantly share code, notes, and snippets.

@gavinmyers
Last active October 4, 2015 20:07
Show Gist options
  • Save gavinmyers/2691306 to your computer and use it in GitHub Desktop.
Save gavinmyers/2691306 to your computer and use it in GitHub Desktop.
Clojure, install and investigation
(defn random-letters [limit iteration]
(println (format "iteration: %s" iteration))
(println (format "limit: %s" limit))
)
(random-letters 25 5)
(defn random-letters [limit iteration]
(println (format "iteration: %s" iteration))
(println (format "limit: %s" limit))
(doseq [i (range limit)]
(println i))
)
(random-letters 25 5)
(defn random-letters [limit iteration]
(println (format "iteration: %s" iteration))
(println (format "limit: %s" limit))
(doseq [i (range limit)]
(def m (mod i iteration))
(println (format "m: %s" m))
)
)
(random-letters 25 5)
(defn random-letters [limit iteration]
(println (format "iteration: %s" iteration))
(println (format "limit: %s" limit))
(doseq [i (range limit)]
(def m (mod i iteration))
(if (= 0 m)
(println (format "i: %s" i))))
)
(random-letters 25 5)
(defn random-letters [limit iteration]
(println (format "iteration: %s" iteration))
(println (format "limit: %s" limit))
(def alphabet "abcdefghijklmnopqrstuvwxyz")
(doseq [i (range limit)]
(def m (mod i iteration))
(if (= 0 m)
(println (format "i: %s" alphabet))))
)
(random-letters 25 5)
(defn random-letters [limit iteration]
(println (format "iteration: %s" iteration))
(println (format "limit: %s" limit))
(def alphabet "abcdefghijklmnopqrstuvwxyz")
(doseq [i (range limit)]
(def m (mod i iteration))
(if (= 0 m)
(println (format "i: %s" (rand-int 26) ))
(println (format "i: %s" alphabet ))
))
)
(random-letters 25 5)
(defn random-letters [limit iteration]
(println (format "iteration: %s" iteration))
(println (format "limit: %s" limit))
(def alphabet "abcdefghijklmnopqrstuvwxyz")
(doseq [i (range limit)]
(def m (mod i iteration))
(if (= 0 m)
(println (format "i: %s" (get alphabet (rand-int 26)) ))
))
)
(random-letters 25 5)
(def alphabet "abcdefghijklmnopqrstuvwxyz")
(defn random-letters [limit iteration]
(repeatedly
(/ limit iteration)
#(str (get alphabet (rand-int 26)) )))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment