about summary refs log tree commit diff
path: root/examples/8.pry
diff options
context:
space:
mode:
Diffstat (limited to 'examples/8.pry')
-rw-r--r--examples/8.pry27
1 files changed, 27 insertions, 0 deletions
diff --git a/examples/8.pry b/examples/8.pry
new file mode 100644
index 0000000..51953d0
--- /dev/null
+++ b/examples/8.pry
@@ -0,0 +1,27 @@
+import "!stdlib.pry";
+
+let main = () => i64 {
+	let fib = (n: i64) => i64 {
+		if n == 0 {
+			return 0;
+		};
+		if n == 1 {
+			return 1;
+		};
+		return fib(n-2) + fib(n-1);
+	};
+
+	let result = fib(30);
+	printf("%d\n", result);
+	return result;
+};
+
+/*
+
+Expected stdout:
+
+832040
+
+Expected return: 832040
+
+*/