diff options
Diffstat (limited to 'examples/8.src')
-rw-r--r-- | examples/8.src | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/8.src b/examples/8.src new file mode 100644 index 0000000..75b5c56 --- /dev/null +++ b/examples/8.src @@ -0,0 +1,15 @@ +let fib = (n) => { + if n == 0 { + return 0; + } + if n == 1 { + return 1; + } + return fib(n-2) + fib(n-1); +}; + +let main = () => { + let result = fib(7); + print(result); + return result; +}; |