japl/examples/fib.jpl

10 lines
172 B
Plaintext
Raw Normal View History

2020-07-29 16:14:17 +02:00
// A recursive implementation of the fibonacci sequence
fun fib(n) {
if (n <= 1) return n;
return fib(n - 2) + fib(n - 1);
}
print(fib(15)); //TODO: Benchmark this