orca/ext/wasm3/test/lang/fib.walt

7 lines
110 B
Plaintext
Raw Permalink Normal View History

2023-04-12 14:21:03 +00:00
export function fib(n: i32): i32 {
if (n < 2) {
return n;
}
return fib(n-1) + fib(n-2);
}