diff options
-rw-r--r-- | examples/7.src | 10 | ||||
-rw-r--r-- | examples/8.src | 15 |
2 files changed, 25 insertions, 0 deletions
diff --git a/examples/7.src b/examples/7.src new file mode 100644 index 0000000..36796cb --- /dev/null +++ b/examples/7.src @@ -0,0 +1,10 @@ +let main = () => { + let i = 4; + + if i == 4 { + print(i); + return i; + } + + return 1; +}; 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; +}; |