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

11 lines
198 B
Plaintext
Raw Normal View History

2022-03-17 18:26:54 -05:00
fun fib (n: int): int = do
2022-04-17 22:41:12 -05:00
case n of
| 1 -> return 1
| 2 -> return 1
| else -> return fib(n - 1) + fib(n - 2)
2022-04-03 03:07:25 -05:00
end
end
2022-03-17 18:26:54 -05:00
fun main: void = do
2022-04-03 03:07:25 -05:00
fib(5) |> @write(_)
end