aboutsummaryrefslogtreecommitdiffstats
path: root/test/fac.scm
diff options
context:
space:
mode:
Diffstat (limited to 'test/fac.scm')
-rw-r--r--test/fac.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/fac.scm b/test/fac.scm
new file mode 100644
index 0000000..0ed384d
--- /dev/null
+++ b/test/fac.scm
@@ -0,0 +1,7 @@
+; Factorial
+(define (fac n)
+ (if (= 0 n) 1
+ (* n (fac (- n 1)))))
+
+(fac 6)
+