3 (require (planet soegaard/sicp:2:1/sicp))
6 (define (flipped-pairs painter)
7 (let ((painter2 (beside painter (flip-vert painter))))
8 (below painter2 painter2)))
10 (define (right-split painter n)
13 (let ((smaller (right-split painter (- n 1))))
14 (beside painter (below smaller smaller)))))
16 (define (corner-split painter n)
19 (let ((up (up-split painter (- n 1)))
20 (right (right-split painter (- n 1))))
21 (let ((top-left (beside up up))
22 (bottom-right (below right right))
23 (corner (corner-split painter (- n 1))))
24 (beside (below painter top-left)
25 (below bottom-right corner))))))
27 (define (square-limit painter n)
28 (let ((quarter (corner-split painter n)))
29 (let ((half (beside (flip-horiz quarter) quarter)))
30 (below (flip-vert half) half))))
32 (define (up-split painter n)
35 (let ((smaller (up-split painter (- n 1))))
36 (below painter (beside smaller smaller)))))