From 0b8a4c4eb921bf28c6800140562343bde220aab2 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Wed, 17 Aug 2016 02:24:33 +0000 Subject: add one/eleven.scm * one/eleven.scm (recursive-fn): add function. --- one/eleven.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 one/eleven.scm diff --git a/one/eleven.scm b/one/eleven.scm new file mode 100644 index 0000000..68e8ce3 --- /dev/null +++ b/one/eleven.scm @@ -0,0 +1,12 @@ +;;; Under Creative Commons Attribution-ShareAlike 4.0 +;;; International. See +;;; . + +(define-module (one eleven) + #:export (recursive-fn)) + +(define (recursive-fn n) + (cond ((<= n 3) n) + (else (+ (* 1 (recursive-fn (- n 1))) + (* 2 (recursive-fn (- n 2))) + (* 3 (recursive-fn (- n 3))))))) -- cgit v1.2.3