1
0
dust/examples/fibonacci.ds

10 lines
115 B
Plaintext
Raw Normal View History

2024-01-28 22:46:15 +00:00
fib = (i <int>, fib <(int) -> int>) <int> {
2023-10-13 19:20:20 +00:00
if i <= 1 {
2023-10-09 19:54:47 +00:00
1
} else {
2024-01-28 22:46:15 +00:00
fib(i - 1) + fib(i - 2)
2023-10-09 19:54:47 +00:00
}
}
2024-01-28 22:46:15 +00:00
fib(8, fib)