diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-18 23:35:28 +0100 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-18 23:35:28 +0100 |
commit | 21a2a60879cdfc6db6533b567471f1442ff4b60a (patch) | |
tree | 7271ef643ba75cb7d16599606978a61491dde693 | |
parent | Feature: Add support for substraction (diff) | |
download | interpreter-21a2a60879cdfc6db6533b567471f1442ff4b60a.tar.gz interpreter-21a2a60879cdfc6db6533b567471f1442ff4b60a.tar.bz2 interpreter-21a2a60879cdfc6db6533b567471f1442ff4b60a.zip |
Example: Get fibonacci example working
-rw-r--r-- | examples/8.src | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/8.src b/examples/8.src index 75b5c56..1ec46e4 100644 --- a/examples/8.src +++ b/examples/8.src @@ -1,10 +1,10 @@ let fib = (n) => { - if n == 0 { + if n { return 0; - } - if n == 1 { + }; + if n - 1 { return 1; - } + }; return fib(n-2) + fib(n-1); }; |