about summary refs log tree commit diff
path: root/users/tazjin/rlox/examples/fib.lox
diff options
context:
space:
mode:
Diffstat (limited to 'users/tazjin/rlox/examples/fib.lox')
-rw-r--r--users/tazjin/rlox/examples/fib.lox6
1 files changed, 6 insertions, 0 deletions
diff --git a/users/tazjin/rlox/examples/fib.lox b/users/tazjin/rlox/examples/fib.lox
new file mode 100644
index 000000000000..1b91e9db94ac
--- /dev/null
+++ b/users/tazjin/rlox/examples/fib.lox
@@ -0,0 +1,6 @@
+fun fib(n) {
+  if (n <= 1) return n;
+  return fib(n - 2) + fib(n - 1);
+}
+
+print fib(30);