読者です 読者をやめる 読者になる 読者になる

(wat-aro)

無職から有職者にランクアップしました

SICP 問題 2.51

scheme SICP
(define (below painter1 painter2)
  (let* ((split-point (make-vect 0.0 0.5))
         (paint-bottom (transform-painter painter1
                                          (make-vect 0.0 0.0)
                                          (make-vect 1.0 0.0)
                                          split-point))
         (paint-upper (transform-painter painter2
                                         split-point
                                         (make-vect 1.0 0.5)
                                         0.0 1.0)))
    (lambda (frame)
      (paint-bottom)
      (paint-upper))))

(define (below painter1 painter2)
  (lambda (frame)
    (rotate270 (beside (rotate90 painter2)
                       (rotate90 painter1)))))