l-99

solutions to l-99 (slow)
Log | Files | Refs | Feed | README

commit fe0c908ce1f9499d25f2d816d72fa666caeb1ba7
parent 11863bd7888208e4616a36ba7061ffe8de7508e7
Author: Jenny Doe <tng@soykaf.me>
Date:   Thu,  2 May 2019 14:31:32 +0200

added: p22.scm

Diffstat:
Ap22.scm | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/p22.scm b/p22.scm @@ -0,0 +1,11 @@ +; (*) Create a list containing all integers within a given range. +; If first argument is smaller than second, produce a list in decreasing +; order. +; Example: +; * (range 4 9) +; (4 5 6 7 8 9) + +(define (range s n) + (if (= s n) + (list n) + (cons s (range ((if (< s n) + -) s 1) n))))