;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: ;;; ;;; Description: ;;; (define unit (/ 100 3)) (define (stripe top height col) (setpos 400 top) (pendown) (color col) (begin_fill) (setpos 400 (- top height)) (setpos -400 (- top height)) (setpos -400 top) (end_fill) (penup) ) (define (gradient top col_list) (cond ((not (null? col_list)) (stripe top unit (car col_list)) (gradient (- top unit) (cdr col_list)) ) ) ) (define (grid loc) (cond ((<= loc 400) (color "#00aeff") (setpos 0 20) (setheading (towards loc 5)) (pendown) (forward 500) (setpos (- (xcor)) (ycor)) (penup) (grid (+ loc 5)) ) ) ) (define (sun) (setpos 0 0) (pendown) (color "#ff7b00") (begin_fill) (circle 80) (end_fill) (penup) (stripe unit unit "#E200E5") (stripe (* 1.35 unit) 5 "#D200E0") (stripe (* 2 unit) 2 "#B300D8") (stripe 100 1 "#B300D8") ) (define (mountain maxheight col) (define maxlen (floor (/ maxheight 2))) (setpos -400 maxlen) (color col) (begin_fill) (pendown) (define (mountain_help d) (cond ((< (xcor) 400) (cond ((> (+ (ycor) maxlen) maxheight) (define d -1)) ((<= (- (ycor) maxlen) 0) (define d 1)) ) (if (> d 0) (setheading 45) (setheading 135) ) (forward (randint 0 maxlen)) (mountain_help (randint -1 1)) ) ) ) (mountain_help (randint -1 1)) (setpos 400 -5) (setpos -400 -5) (end_fill) (penup) ) (define (draw) (penup) (speed 0) (define groundgrad (list "#281028" "#280F32" "#290E3D" "#2A0E48" "#2B0D53" "#2C0C5E" "#2D0C69" "#2E0B74" "#300A8A")) (gradient 0 groundgrad) (grid -400) (define skygrad (list "#5500BF" "#6400C3" "#7400C7" "#8400CB" "#9300CF" "#A300D4" "#B300D8" "#D200E0" "#E200E5")) (gradient 300 skygrad) (sun) (mountain 75 "#3c008c") (mountain 40 "#060023") (exitonclick)) ; Please leave this last line alone. You may add additional procedures above ; this line. (draw)