;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: d a n g e r cloud ;;; ;;; Description: ;;; should I use the Cloud? ;;; with one gust, afar it storms ;;; split splat split splat split (define (draw) (speed 100000) (define (fake_rng num) (define nined (* 9 num)) (define new_num (+ (floor (/ nined 10)) (modulo nined 100))) (cons-stream (- new_num 475) (fake_rng new_num)) ) (define (prop_scale val scalar) (if (> (abs (* val scalar)) 1.0) val (* val scalar) ) ) (define (set_position x y) (setposition (- x 420) (- y 393.5))) ; different coordinate systems? (define (draw_ocean row row_scale rng_strm) (define (draw_row curr_x y row_scale rng_strm) (define (gradient_circ tot_r ord red green blue rng_strm) (if (not (eq? ord 1)) (begin (define r (* (/ ord 5) tot_r)) (color (rgb (prop_scale red (* (abs (/ (car rng_strm) 100)) (expt 1.1 ord))) (prop_scale green (* (abs (/ (car rng_strm) 100)) (expt 1.1 ord))) (prop_scale blue (* (abs (/ (car rng_strm) 60)) (expt 1.1 ord))) )) (begin_fill) (circle r) (end_fill) (left 90) (forward (+ (* .3 r) (/ (car rng_strm) 4))) (right 90) (gradient_circ tot_r (- ord 1) red green blue (cdr-stream rng_strm)) ) ) ) (if (> curr_x 240) (begin (define next_random_ratio (* (car (cdr-stream rng_strm)) 1.5)) (penup) (set_position curr_x (+ y (* (car rng_strm) 2.5))) (pendown) (gradient_circ (* (abs (* (/ next_random_ratio 40) 80)) row_scale) 5 .6 .6 .9 rng_strm) (draw_row (- curr_x (abs (* (/ next_random_ratio 40) 90))) y row_scale (cdr-stream rng_strm) ) (cdr-stream rng_strm) ) ) ) (if (not (= row 4)) (draw_ocean (+ row 1) (+ .3 row_scale) (cdr-stream (draw_row 740 (- 600 (* 100 row)) row_scale rng_strm)) ) ) ) (draw_ocean 0 .3 (cdr-stream (fake_rng 500))) (exitonclick) ) ; Please leave this last line alone. You may add additional procedures above ; this line. (draw)