;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: Geometric Groove ;;; ;;; Description: ;;; The circle and square ;;; unite in harmony where ;;; their beauty is shared. ; the color palette (define rainbow (list "#dd1e2f" "#ebb035" "#06a2cb" "#218559" "#d0c6b1" "#192823" "#666666" "#d1082c" "#f2b330" "#0c94b7" "#1a7f53")) ; draw a circle with color c and radius r at (x, y) (define (crcl c r x y) (pu) (goto (+ x r) y) (pd) (color c) (begin_fill) (circle r) (end_fill)) ; draw a square with color c and side length 2r at (x, y) (define (sqr c r x y) (pu) (goto (- x r) (- y r)) (pd) (color c) (begin_fill) (define (ds) (begin (fd (* 2 r)) (rt 90))) (ds) (ds) (ds) (ds) (end_fill)) ; recursively draw n concentric shapes with random colors and radius r at (x, y) (define (concentric shape r x y n) (shape (index rainbow (random 0 10)) r x y) (if (> n 1) (concentric shape (- r 10) x y (- n 1)))) ; tree recursively draw a grid of square tiles from (fromx, fromy) to (tox, toy) (define (grid fromx fromy tox toy) (define (make) (concentric sqr 70 fromx fromy 7)) (if (or (> fromx tox) (> fromy toy)) 'done (begin (make) (grid (+ fromx 160) fromy tox toy) (grid fromx (+ fromy 160) tox toy)))) ; draw n bubbles (concentric circles of varying colors, sizes, and locations) (define (bubbles n) (define s (random 1 7)) (concentric crcl (* s 10) (random -320 320) (random -320 320) s) (if (> n 1) (bubbles (- n 1)))) (define (draw) (speed 0) (bgcolor "black") (grid -240 -240 240 240) (bubbles 16) (grid -160 -160 160 160) (bubbles 9) (grid -80 -80 80 80) (bubbles 4) (grid 0 0 0 0) (ht) (exitonclick)) ; Inspired by fall 2014 submission 'Postmodern Holiday' ; Please leave this last line alone. You may add additional procedures above ; this line. (draw)