Skip to content

Instantly share code, notes, and snippets.

@lepoetemaudit
Created August 26, 2015 20:05
Show Gist options
  • Save lepoetemaudit/a774f9e9137b6b816fc1 to your computer and use it in GitHub Desktop.
Save lepoetemaudit/a774f9e9137b6b816fc1 to your computer and use it in GitHub Desktop.
Toki Pona numbers in Clojure ported from OCaml
(defn numberToTokiPona [num]
(clojure.string/join " "
(loop [n num strs []]
(cond
(> n 1) (recur (- n 2) (conj strs "twu"))
(= n 1) (recur (- n 1) (conj strs "wan"))
:else strs))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment