Fixed an argument list bug, found a casting bug

This commit is contained in:
2022-09-03 16:04:18 +01:00
parent 32d6b7124c
commit 86061cb74e
2 changed files with 19 additions and 0 deletions

12
scripts/fib.toy Normal file
View File

@@ -0,0 +1,12 @@
fn fib(n : int) {
if (n < 2) {
return n;
}
return fib(n-1) + fib(n-2);
}
for (var i = 0; i < 40; i++) {
var res = fib(i);
print (string)i + ": " + (string)res;
}