Last active
October 4, 2015 20:07
-
-
Save gavinmyers/2691306 to your computer and use it in GitHub Desktop.
Clojure, install and investigation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn random-letters [limit iteration] | |
(println (format "iteration: %s" iteration)) | |
(println (format "limit: %s" limit)) | |
) | |
(random-letters 25 5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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