diff options
author | rsiddharth <s@ricketyspace.net> | 2016-08-17 02:24:33 +0000 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2016-08-17 02:24:33 +0000 |
commit | 0b8a4c4eb921bf28c6800140562343bde220aab2 (patch) | |
tree | c482083b44298b036bc1f33f3b158150bf34f9c6 /one | |
parent | a394d0140222bb7939cbcf3f27f2ad6ca0b7f1d7 (diff) |
add one/eleven.scm
* one/eleven.scm (recursive-fn): add function.
Diffstat (limited to 'one')
-rw-r--r-- | one/eleven.scm | 12 |
1 files changed, 12 insertions, 0 deletions
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 +;;; <https://creativecommons.org/licenses/by-sa/4.0/>. + +(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))))))) |