up-split
的定义和 right-split
的定义非常相似,唯一的区别是 beside
和 below
的位置不同:
;;; 44-up-split.scm
(define (up-split painter n)
(if (= n 0)
painter
(let ((smaller (up-split painter (- n 1))))
(below painter
(beside smaller smaller)))))