sicp 2.44

Exercise 2.44.  Define the procedure up-split used by corner-split. It is similar to right-split, except that it switches the roles ofbelow and beside.

 

参考right-split,比较简单:

 

 

(define (up-split painter n)
  (if (= n 0)
      painter
      (let ((smaller (up-split painter (- n 1))))
        (below painter (beside smaller smaller)))))

你可能感兴趣的:(SICP)