;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: ;;; ;;; Description: ;;; (speed 0) (define sc-width (screen_width)) (define sc-height (screen_height)) (define bottom-right-x (/ sc-width 2)) (define bottom-right-y (* -1 (/ sc-height 2))) (define bottom-left-x (* -1 (/ sc-width 2))) (define bottom-left-y (* -1 (/ sc-height 2))) (define (has-seven k) (cond ((= (modulo k 10) 7) #t) ((< k 10) #f) (else (has-seven (quotient k 10))) ) ) (define lst (list 40 30 15 1 -15 -25 -30)) (define increase-lst (list 5 10 15 5 10 15 20)) (define colors (list "#FF9D48" "#FA7D47" "#EF4335" "#7F0131" "#500130" "#2C0F2B" "black")) (define (higher-order fn lst increase-lst color) (if (null? lst) 0 (begin (penup) (begin_fill) (fn 1 0 (car lst) 170 bottom-left-x (car increase-lst) (car color)) (end_fill) (penup) (higher-order fn (cdr lst) (cdr increase-lst) (cdr color))) ) ) (define (draw) (bgcolor "#FDD7C0") (define (pingpong direction index integer stop step increase new-color) (print integer) (color new-color) (setposition step (* integer 10)) (pendown) (cond ((= index stop) (begin (setposition bottom-right-x bottom-right-y) (setposition bottom-left-x bottom-left-y) (setposition (* -1 (/(screen_width) 2)) 50) 1 )) ((or (= (modulo index 7) 0) (has-seven index)) (pingpong (* -1 direction) (+ 1 index) (- integer direction) stop (+ increase step) increase new-color)) (else (pingpong direction (+ 1 index) (+ integer direction) stop (+ increase step) increase new-color)) ) ) (higher-order pingpong lst increase-lst colors) (exitonclick) ) ; Please leave this last line alone. You may add additional procedures above ; this line. (draw)