Created
August 25, 2015 23:13
-
-
Save lepoetemaudit/88c2541e7cdf7745a147 to your computer and use it in GitHub Desktop.
The Toki Pona number converter implementation ported from F# to 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
let numberToTokiPona num = | |
let rec addNum num str = | |
if num >= 2 then addNum (num-2) (str ^ "twu ") | |
else if num = 1 then addNum (num-1) (str ^ "wan ") | |
else str | |
in | |
if num > 0 then addNum num "" | |
else "ala";; | |
print_string (numberToTokiPona 19);; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment