2.52 Exercise 2.52
I did not make the wave painter in Exercise 2.49, so I will not be adding segments to it.
To modify corner-split, I will apply a flip-horiz to the base case and to the bottom-left painter:
(define (corner-split painter n) (if (= n 0) (flip-horiz painter) (let ((up (up-split painter (- n 1))) (right (right-split painter (- n 1)))) (let ((top-left (beside up up)) (bottom-right (below up right)) (corner (corner-split painter (- n 1)))) (beside (below (flip-horiz painter) top-left) (below bottom-right corner))))))
To modify square-limit, I will make the patterns face outward by swapping the left and right halves in the square-of-four call:
(define (square-limit painter n) (let ((combine4 (square-of-four identity flip-horiz flip-vert rotate180))) (combine4 (corner-split painter n))))
