Lojban
The Logical Language
Log in
Username:
Password:
I forgot my password |
CapsLock is on.
Log in
History: samtrosku examples
View page
Source of version: 1
(current)
__coi__ (the quintessential first program) Program: .i ko cusku lo'u ui coi munje le'u Output: .ui coi munje (Yes, a dot would be inserted - I assume that in displaying Lojban strings, which are different from character strings, the samtrosku interpreter would choose the most canonical form.) ---- __nu'a ne'o__ (factorial) Assuming that factorial isn't a built-in operation with {ne'o}, you could implement it as the brivla {nu'a ne'o}: .i ca'e ko'a nu'a ne'o ko'e ijo ('X == Y factorial' is defined as:) tu'e ny goi 1 (n = 1) .i ko zukte di'e ca le du'u ko'e zmadu li 1 (while Y > 1 do this...) .itu'e ko dungau ny li ny pi'i ko'e (n = n*Y) .i ko dungau ko'e li ko'e vu'u 1 (Y = Y-1) tu'u .i ko'a jagdu'o ny (return n as the value of X) tu'u
About
Introduction
What Others Say
FAQ
Learning
Books
Vocabulary
Lojbanic Software
Community
Web/Email Forums
IRC Chat
Links
News
Dictionary
Swag
Multimedia
Lojbanic Texts
Audio
Wiki
Recent Changes
Popular Pages
How To Edit
The LLG
Official Projects
Publications
Donate!
Contact Us
Search Lojban Resources