(wat-aro)

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

SICP 問題 2.49

;; a
(define (outline-painter frame)
  (let* ((v00 (make-vect 0 0))
         (v01 (make-vect 0 1))
         (v10 (make-vect 1 0))
         (v11 (make-vect 1 1)))
    ((segments->painter (list (make-segment v00 v01)
                              (make-segment v00 v10)
                              (make-segment v10 v01)
                              (make-segment v01 v10)))
     frame)))

;; b
(define (x-painter frame)
  (let* ((v00 (make-vect 0 0))
         (v01 (make-vect 0 1))
         (v11 (make-vect 1 1))
         (v10 (make-vect 1 0)))
    ((segments->painter (list (make-segment v00 v11)
                              (make-segment v01 v10)))
     frame)))

;; c
(define (Rhombus-painter frame)
  (let* ((va (make-vect 0.5 0))
         (vb (make-vect 1 0.5))
         (vc (make-vect 0.5 1))
         (vd (make-vect 0 0.5)))
    ((segments->painter (list (make-segment va vb)
                              (make-segment vb vc)
                              (make-segment vc vd)
                              (make-segment vd va)))
     frame)))

;; d
;;  パス