1
1
Fork 0
mirror of https://github.com/azur1s/bobbylisp.git synced 2024-10-16 02:37:40 -05:00
bobbylisp/examples/factorial.hlm
2022-12-20 21:21:21 +07:00

9 lines
177 B
Plaintext

fun factorial n =
let helper = \n acc ->
if n > 0
then helper(n - 1, acc * n)
else acc
in
helper(n, 1)
fun main = println(factorial(20))