Created
July 13, 2018 14:32
-
-
Save kocubinski/c81d4140e10065bc7866e0dca0b1d2d1 to your computer and use it in GitHub Desktop.
generate random words
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
(ns moon-moon.core | |
(:require [clojure.java.io :as io] | |
[clojure.string :as str])) | |
(defn rand-words | |
[] | |
(with-open [reader (io/reader "/usr/share/dict/words")] | |
(->> (line-seq reader) | |
(filter (partial re-matches #"[a-z]{0,7}")) | |
(partial rand-nth) | |
(repeatedly 2) | |
(str/join "-")))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment