summary refs log tree commit diff
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-18 23:35:28 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-18 23:35:28 +0100
commit21a2a60879cdfc6db6533b567471f1442ff4b60a (patch)
tree7271ef643ba75cb7d16599606978a61491dde693
parentFeature: Add support for substraction (diff)
downloadinterpreter-21a2a60879cdfc6db6533b567471f1442ff4b60a.tar.gz
interpreter-21a2a60879cdfc6db6533b567471f1442ff4b60a.tar.bz2
interpreter-21a2a60879cdfc6db6533b567471f1442ff4b60a.zip
Example: Get fibonacci example working
-rw-r--r--examples/8.src8
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);
 };