japl-python/examples/fib.jpl

13 lines
201 B
Plaintext
Raw Normal View History

2020-10-22 10:19:00 +02:00
// A recursive implementation of the fibonacci sequence
fun fib(n) {
if (n <= 1) return n;
return fib(n - 2) + fib(n - 1);
}
var start = clock();
fib(30);
var end = clock() - start;
print(end);