control flow
This commit is contained in:
10
IBAF-Tests/IBAF-1/fibforfun.ibaf
Normal file
10
IBAF-Tests/IBAF-1/fibforfun.ibaf
Normal file
@@ -0,0 +1,10 @@
|
||||
fun fib(n) {
|
||||
if (n <= 1) {
|
||||
return n;
|
||||
}
|
||||
return fib(n-1) + fib(n-2);
|
||||
}
|
||||
|
||||
for (int n = 0; n < 8) {
|
||||
print(fib(n));
|
||||
}
|
||||
Reference in New Issue
Block a user