Add good old factorial.

This commit is contained in:
Danila Fedorin 2019-06-12 19:31:49 -07:00
parent df33263fcd
commit 17c5486551

12
programs/factorial.lily Normal file
View File

@ -0,0 +1,12 @@
defn if c t e = {
case c of {
True -> { t }
False -> { e }
}
}
defn fact n = {
if (eq n 0) 1 (n * fact (n - 1))
}
defn main = { fact 6 }