;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: ;;; ;;; Description: ;;; (define (draw) (rectangle -100 -500 100 500 "#703566") (rectangle 100 -500 300 500 "#4F2874") (rectangle 300 -500 500 500 "#351B5E") (moon) (define mainc "#2F223E") (building -500 -400 -100 160 "a") (building -500 250 400 500 "a") (define mainc "#17264F") (building 100 -500 310 -280 "c") (building -500 100 0 350 "b") (building -500 -500 100 -240 "c") (define mainc "#3F3365") (building -500 -200 -250 275 "a2") (building -260 -200 200 75 "a2") (exitonclick) ) ; "Creates rectangles of a specified size and color. Really important given that I basically only use rectangles." (define (rectangle bot-y left-x top-y right-x c) (color c) (setposition left-x bot-y) (begin_fill) (setposition right-x bot-y) (setposition right-x top-y) (setposition left-x top-y) (setposition left-x bot-y) (end_fill) (penup) ) ;(define (shape coords c) ; (color c) ; (begin_fill) ; (define (helper coords) ; (setposition (car (car coords) (cdr (car coords)))) ; (if (equal? (cdr coords) nil) ; nil ; (helper (cdr coords)) ; ) ; ) ; (end_fill) ; ) ; "Creates moon" (define (moon) (setposition 300 200) (begin_fill) (color "#ff0000") (circle 150) (end_fill) ) (define aplusx (mu (a) (+ a x)) ) ; "Creates a building that has specific dimensions and window types" (define building (bot-y left-x top-y right-x type) (define (type-a x y z) ; grid (rectangle y x (+ y z) (aplusx (- z 5)) "#365DA0") (cond [(and (> (aplusx 30) right-x) (> (+ y 50) top-y)) nil] [(> (aplusx 30) right-x) (type-a (+ left-x 10) (+ y 30) z)] [else (type-a (aplusx 20) y z)] ) ) (define (type-b x) ; vertical strips (rectangle bot-y x top-y (aplusx 10) "#365DA0") (if (> x (- right-x 30)) nil (type-b (aplusx 25)) ) ) (define (type-c y) ; horizontal strips (rectangle y left-x (+ y 10) right-x "#365DA0") (if (> y (- top-y 25)) nil (type-c (+ y 25)) ) ) (rectangle bot-y left-x top-y right-x mainc) (cond [(equal? type "a") (type-a (+ left-x 10) (+ bot-y 10) 15)] [(equal? type "a2") (type-a (+ left-x 10) (+ bot-y 10) 20)] [(equal? type "b") (type-b (+ left-x 10))] [else (type-c (+ 20 bot-y))] ) ) ; Please leave this last line alone. You may add additional procedures above ; this line. (draw)