Files
monkey/examples/fact.monkey
Chuck Smith 6282075e66
Some checks failed
Build / build (push) Successful in 10m26s
Test / build (push) Failing after 16m44s
bind expression (:=) instead of let
2024-03-21 17:43:03 -04:00

8 lines
117 B
Plaintext

fact := fn(n) {
if (n == 0) {
return 1
}
return n * fact(n - 1)
}
assert(fact(5) == 120, "fact(5) != 120")