implementing native functions (ch24)
This commit is contained in:
9
samples/ch24_fib.lox
Normal file
9
samples/ch24_fib.lox
Normal file
@ -0,0 +1,9 @@
|
||||
fun fib(n) {
|
||||
if (n < 2) return n;
|
||||
return fib(n - 2) + fib(n - 1);
|
||||
}
|
||||
|
||||
var start = clock();
|
||||
|
||||
print fib(20);
|
||||
print clock() - start;
|
Reference in New Issue
Block a user