Skip to content

Instantly share code, notes, and snippets.

@nasser
Created October 6, 2015 19:04
Show Gist options
  • Save nasser/1db446782cf7f3587283 to your computer and use it in GitHub Desktop.
Save nasser/1db446782cf7f3587283 to your computer and use it in GitHub Desktop.
(ns names
(:refer-clojure :exclude [name])
(:use nq.core))
(defmacro ? [xs]
`(rand-nth ~xs))
(defn stitch [xs]
(->> xs
flatten
(interleave (repeat " "))
(drop 1)
(apply str)))
(def organizations ["movement" "army" "militia" "party" "kinship" "revolution" "front"])
(def members ["striking hand" "liberators" "children" "sons and daughters" "defenders" "friends" "guardians"])
(def bigs ["people" "zaim" "sultan" "world" "earth" "oppressed" "forgotten" "poor"])
(def adjectives ["people's" "brave" "invincible" "unstoppable" "righteous" "just" "honorable" "terrifying" "peaceful"])
(def place-prefixes ["kfar" "tel" "jourat" "borj" "wadi" "ras" "jal" "jabal" "ain"])
(def place-names ["zaatar" "heem" "kfour" "ghodras" "tirmos"])
(defn place []
(chance 1 [(rand-nth place-prefixes)
(rand-nth place-names)]
[(rand-nth place-names)]))
(defn name []
(stitch
(chance
1 [(chance 1 "the"
1 ["the" (? adjectives)])
(chance 1 (? members)
1 (? organizations))
(chance 1 ["of" (place)]
1 ["of the" (? bigs)])])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment