【SICP练习】80 练习2.52

简介:


练习2.52

在这道题上面的文字中就说到了用segments->painter提供线段表,这里的a小题的代码如下:

(segments->painter (list(make-segment (make-vect 0.0 0.0)

                                      (make-vect 1.0 1.0))

                       (make-segment ......)))

b小题代码如下:

(define (corner-split painter n)

   (if (= n 0)

      painter

      (let ((up (up-split painter (- n 1)))

           (right (right-split painter (- n1)))

            (corner (corner-split painter (- n1))))

        (beside (below painter up)

                (below right corner)))))

c小题代码如下:

(define (square-limit painter n)

  (let ((combine4 (square-of-four identity flip-horiz)

                      flip-vect rotate180))

        (combine4 (corner-split painter n))))

目录
相关文章
|
数据安全/隐私保护
|
关系型数据库 vr&ar