]> Nishi Git Mirror - gwion.git/commitdiff
:wrench: Argument Defaults testing
authorJérémie Astor <fennecdjay@gmail.com>
Wed, 19 May 2021 18:14:39 +0000 (20:14 +0200)
committerJérémie Astor <fennecdjay@gmail.com>
Wed, 19 May 2021 18:14:39 +0000 (20:14 +0200)
tests/tree/fib-tail.gw [new file with mode: 0644]

diff --git a/tests/tree/fib-tail.gw b/tests/tree/fib-tail.gw
new file mode 100644 (file)
index 0000000..4cd3c4a
--- /dev/null
@@ -0,0 +1,10 @@
+#! [contains] 102334155
+fun int fib(int n, int a : 0, int b : 1) {
+    if (n == 0)
+        return a;
+    if (n == 1)
+        return b;
+    return fib(n - 1, b, a + b);
+}
+
+<<< fib(40, 0) >>>;