;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: Get DeoxyRiboNucleated with Exactly 255 Scheme Tokens ;;; ;;; Description: ;;; Random DNA. ;;; Always a different sequence ;;; One is surely yours. (define (line sx sy ex ey) (penup) (goto sx sy) (let ((x_diff (- ex sx)) (y_diff (- ey sy))) (if (= 0 x_diff) () (begin (setheading (- 90 (* 57.2958 (atan (/ y_diff x_diff))))) (pendown) (forward (sqrt (+ (* y_diff y_diff) (* x_diff x_diff)))) )))) (define (v_dna lx_start lx_end rx_start rx_end curr_y offset n) (cond ((< curr_y -300) ()) (else (let ((col (abs curr_y)) (col2 (max 0.4 (abs (sin (/ curr_y 2))))) (val (abs (sin (/ curr_y 50))))) (if (< (modulo col 25) 7) (begin (if (= n 0) (define n (random 5)) ()) (define pt (/ (+ rx_start lx_end) 2)) (color (cond ((= n 3) (rgb 0.1 0.1 col2)) ((= n 1) (rgb 0.1 col2 0.1)) ((= n 2) (rgb col2 0.1 0.1)) (else (rgb col2 0.35 0)))) (line lx_end curr_y pt curr_y) (color (cond ((= n 1) (rgb 0.1 0.1 col2)) ((= n 3) (rgb 0.1 col2 0.1)) ((= n 2) (rgb col2 0.45 0)) (else (rgb col2 0.1 0.1)))) (line pt curr_y rx_start curr_y) ) (define n 0)) (begin (color (rgb 0 (- 1 (/ col 450)) (- 1 (/ col 350)))) (line lx_start curr_y lx_end curr_y) (color (rgb 0 (- 1 (/ col 350)) (- 1 (/ col 450)))) (line rx_start curr_y rx_end curr_y) (v_dna (+ offset (* 50 (- val))) (+ 15 offset (* 50 (- val))) (+ offset (* 50 val)) (+ 15 offset (* 50 val)) (- curr_y 0.1) offset n) ))))) (define (draw) (text 'DNA) (v_dna 170 180 180 170 300 200 0) (v_dna 170 180 180 170 300 -200 0) (exitonclick)) ; Please leave this last line alone. You may add additional procedures above ; this line. (draw)