(define colors1 (list color.red color.green color.blue color.black (cname->rgb "neon avocado"))) (define colors2 (list color.magenta color.purple (cname->rgb "hot pink") (cname->rgb "medium forest green") color.yellow)) (define hair-brushes (list "Calligraphic Brush" "Circle (03)" "Circle (05)" "Circle Fuzzy (03)" "Felt Pen")) (define create-drawing (lambda (filename val1 val2 val3) (let* ((port (open-output-file filename)) (x (+ 16 val2)) ;x determines the size of the drawing (color1 (list-ref colors1 (modulo val1 5))) ;color1 is the main outline color (color2 (list-ref colors2 (modulo val3 5))) ;color2 is the secondary, fill-in color (brush (list-ref hair-brushes (modulo val2 5))) ;brush is the brush. Hmmm.... (draw-house (lambda () (empty-square.write port color1 brush 0 (* 4 x) (* 4 x)) (line.write port color1 brush (* 4 x) (* 8 x) (* 7 x) (* 6 x)) (line.write port color1 brush (* 4 x) (* 4 x) (* 7 x) (* 2 x)) (line.write port color1 brush (* 7 x) (* 6 x) (* 7 x) (* 2 x)) (line.write port color1 brush 0 (* 4 x) (* 2 x) (* 2 x)) (line.write port color1 brush (* 2 x) (* 2 x) (* 4 x) (* 4 x)) (line.write port color1 brush (* 2 x) (* 2 x) (* 5 x) 0) (line.write port color1 brush (* 5 x) 0 (* 7 x) (* 2 x)) (filled-rectangle.write port color2 (* 1.5 x) (* 6 x) x (* 2 x)))) (draw-skull (lambda () (empty-circle.write port color1 brush 0 0 (* 8 x)) (line.write port color1 brush (* 2 x) (* 7.4641 x) (* 2 x) (* 10 x)) (line.write port color1 brush (* 3 x) (* 7.873 x) (* 3 x) (* 10 x)) (line.write port color1 brush (* 4 x) (* 8 x) (* 4 x) (* 10 x)) (line.write port color1 brush (* 5 x) (* 7.873 x) (* 5 x) (* 10 x)) (line.write port color1 brush (* 6 x) (* 7.4641 x) (* 6 x) (* 10 x)) (line.write port color1 brush (* 2 x) (* 10 x) (* 6 x) (* 10 x)) (line.write port color1 brush (* 3 x) (* 5 x) (* 4 x) (* 4 x)) (line.write port color1 brush (* 4 x) (* 4 x) (* 5 x) (* 5 x)) (line.write port color1 brush (* 3 x) (* 5 x) (* 5 x) (* 5 x)) (filled-circle.write port color2 (* 2 x) (* 2 x) x) (filled-circle.write port color2 (* 5 x) (* 2 x) x)))) (if (< val1 5) (draw-house) (draw-skull)) (close-output-port port))))