また悩む…
僕の解答
力技!
null?とかappendとか…
(define (disp-list n) (display n) (newline) n) (define (row-iter n src dest) (if (null? src) (append dest (list n)) (row-iter (car src) (cdr src) (append dest (list (+ n (car src))))))) (define (row src) (row-iter (car src) (cdr src) '(1))) (define (f n) (if (= n 1) (disp-list '(1)) (disp-list (row (f (- n 1))))))
解答例
所感
ちょう勘違い!
うーん、解答例だとすっきりじゃーん…