Created
August 26, 2015 20:05
-
-
Save lepoetemaudit/a774f9e9137b6b816fc1 to your computer and use it in GitHub Desktop.
Toki Pona numbers in Clojure ported from OCaml
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
(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