Skip to content

Instantly share code, notes, and snippets.

@kocubinski
Created June 20, 2019 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kocubinski/e5f1d7b0f8199235d3d7cfa4d9e1fbfd to your computer and use it in GitHub Desktop.
Save kocubinski/e5f1d7b0f8199235d3d7cfa4d9e1fbfd to your computer and use it in GitHub Desktop.
(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 "-"))))
@kocubinski
Copy link
Author

Generate random word combinations for fun and profit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment