1
1
Fork 0
mirror of https://github.com/azur1s/bobbylisp.git synced 2024-10-16 02:37:40 -05:00

Create factorial.hz

This commit is contained in:
Natapat Samutpong 2022-03-19 10:03:43 +07:00
parent 6a34347a32
commit d5feadd70b

10
example/factorial.hz Normal file
View file

@ -0,0 +1,10 @@
fun factorial (n: int): int = do
case n of
| 0 -> return 1;
\ return n * factorial(n - 1);
end;
end;
fun main: void = do
factorial(5) |> @write(_);
end;