• 【SICP练习】79 练习2.51


            练习2.51

    通过书中前面的内容,我们知道below中来将框架分成上下两部分,而beside将框架分成左右两部分。因此,below定义如下:

    (define (below painter1 painter2)

      (let ((split-point (make-vect 0.0 0.5)))

         (let ((paint-top (transform-painter painter2

                                          split-point

                                          (make-vect 1.0 0.5)

                                          (make-vect 0.0 1.0)))

              (paint-down (transform-painterpainter1

                                            (make-vect 0.0 0.0)

                                            (make-vect 1.0 0.0)

                                            split-point)))

           (lambda (frame)

                (paint-top frame)

                (paint-down frame)))))

    另一种利用上一题中的rotate270等可以很容易的实现:

    (define (below painter1 painter2)

         (lambda (frame)

             ((flip-horiz

                  (rotate90

                      (beside

                          (rotate270

                             (flip-horizpainter1))

                          (rotate270

                             (flip-horizpainter2)))))

               frame)))

    版权声明:本文为 NoMasp柯于旺 原创文章,如需转载请联系本人。

  • 相关阅读:
    PHP 快递单号查询api接口源码指导
    电商平台适用基础快递查询api接口对接demo解决方案
    智能物流查询api接口demo(php示例)
    解决在TP5中无法使用快递鸟查询API接口方案
    解析快递鸟在线预约取件API接口对接编码
    快递鸟批量打印电子面单接口及控件安装
    「note」原根照抄
    「atcoder
    Solution -「NOI 2021」轻重边
    Solution Set -「ARC 124」
  • 原文地址:https://www.cnblogs.com/NoMasp/p/4786140.html
Copyright © 2020-2023  润新知