Giblang

Giblang

This is a little script I use to generate asemic titles and names for the things I work on. It is notably used to generate titles for my Breathing Cards.

The main idea is to build up words one syllable at a time. A syllable is a random pairing of a consonant sound and a vowel sound.

(def cons (array
           "b" "c" "d" "f"
           "g" "h" "j" "k"
           "l" "m" "n" "p"
           "r" "s" "t" "v"
           "w" "z" "ch" "sh"
           "zh"))

(def vow (array "a" "e" "i" "o" "u" "y" "ee" "ai" "ae"))

(defn rpick (t)
  (t (math/floor (* (math/random) (length t)))))


(defn seed () (math/seedrandom (os/time)))

(defn syl () (string (rpick cons) (rpick vow)))

(defn word ()
  (do
    (var str "")
    (for i 0 (+ (math/floor (* (math/random) 3)) 1)
      (set str (string str (syl))))
    (cond (> (math/random) 0.2)
          (set str (string str (rpick cons))))
    (string str)))

(seed)
(print (word))