mlox/lox.t/fib.lox

6 lines
107 B
Lox

fun fib(n) {
if (n < 2) return n;
return fib(n - 2) + fib(n - 1);
}
print fib(35); // expect: 9227465