乐正

Actions speak louder than words.

Sicp-ex2-44

问题

请定义出corner-split里使用的过程up-split,它与right-split相似,除在其中交换了belowbeside的角色之外。

解答

练习2.44 (ex2-44.scm) download
1
2
3
4
5
(define (up-split painter n)
    (if (= n 0)
        painter
        (let ((smaller (up-split painter (- n 1)))
            (below painter (beside smaller smaller))))))

draft

« sicp-ex2-43 sicp-ex2-45 »

Comments