(define create-drawing (lambda (filename val1 val2 val3) (let* ((house-width (+ 80 (* 20 (modulo val1 5)))) (window-square? (= 1 (quotient val1 5))) (num-stories (+ 2 (quotient val2 5))) (brush (list-ref (list "Calligraphic Brush#3" "square (5x5)" "Circle (03)" "Circle (05)" "Diagonal Star (11)") (modulo val2 5))) (door-right? (= 1 (quotient val3 5))) (paint-color (list-ref (list color.red color.green color.magenta color.cyan color.yellow) (modulo val3 5))) (outport (open-output-file filename)) (window.write (lambda (left top width height) (cond (window-square? (empty-rectangle.write outport color.black brush left top width height)) (else (empty-ellipse.write outport color.black brush left top width height))) (line.write outport color.black brush (+ left (* 0.5 width)) top (+ left (* 0.5 width)) (+ top height)) (line.write outport color.black brush left (+ top (* 0.5 height)) (+ left width) (+ top (* 0.5 height)))))) (filled-rectangle.write outport paint-color (* 0.5 (- 200 house-width)) (- 190 (* 50 num-stories)) house-width (* 50 num-stories)) (filled-rectangle.write outport color.brown (- 90 (* 0.5 house-width)) (- 175 (* 50 num-stories)) (+ house-width 20) 15) (cond (door-right? (filled-rectangle.write outport color.brown (+ 92 (* 0.25 house-width)) 150 16 40) (filled-square.write outport color.black (+ 93 (* 0.25 house-width)) 170 3 3)) (else (filled-rectangle.write outport color.brown (- 92 (* 0.25 house-width)) 150 16 40) (filled-square.write outport color.black (- 93 (* 0.25 house-width)) 170 3 3))) (window.write (- 105 (* 0.5 house-width)) 95 (- (* 0.5 house-width) 10) 40) (window.write 105 95 (- (* 0.5 house-width) 10) 40) (cond (door-right? (window.write (- 105 (* 0.5 house-width)) 145 (- (* 0.5 house-width) 10) 40)) (else (window.write 105 145 (- (* 0.5 house-width) 10) 40))) (cond ((= num-stories 3) (window.write (- 105 (* 0.5 house-width)) 45 (- (* 0.5 house-width) 10) 40) (window.write 105 45 (- (* 0.5 house-width) 10) 40))))))