Follow

**Numbers**
Well-known languages generally have a O(log n) way of expressing the natural number n. Toki Pona, on the other hand, has words only for "one" (wan), "two" (tu), "five" (luka, which also means "hand"), and "many" (mute), and these words are additive. For example, thirteen is mute or luka luka tu wan. Expressing specific numbers greater than twenty in such an O(n) system is uncommon. Below is a Scheme program that translates a number into this notation.

;;; int->tokipona
;;; Scheme code to return the name of a positive integer
;;; in the Toki Pona language.
;;; By Damian Yerrick (jan Tepo li pali e ni)
(define int->tokipona
(letrec ((iter
(lambda (n)
(cond
((>= n 5) (cons "luka " (iter (- n 5))))
((>= n 2) (cons "tu " (iter (- n 2))))
((>= n 1) '("wan "))
(else '())))))
(lambda (n)
(apply string-append (iter n)))))
This is a Befunge program that does the same thing, by Lament (jan Nikita):

&>:!#@_:4`-:"naw">:#,_@
>^#<$:-1$<@>:4+>$0" akul">:#,_v
$5-^>:#,_^#:"tu "<<(c) Lament>>

archive.vn/gMrlT

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.