;;; Scheme Recursive Art Contest Entry ;;; ;;; Please do not include your name or personal info in this file. ;;; ;;; Title: Pleasant Vibes ;;; ;;; Description: ;;; Finals in two weeks, ;;; Let's cut some stress for now ;;; And sprout some good vibes :) ;;; helper functions for creating the sun and flower (define (arc_sun size) (cond ( (> size 0) (fd 2) (rt 1) (arc_sun (- size 1))) (else nil) ) ) (define (arc_flower size) (cond ( (> size 0) (fd 3) (rt 1) (arc_flower (- size 1))) (else nil) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; CREATES THE SUN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; chooses color (define (color_sun num) (cond ( (even? num) (color "red") ) ( else (color "orange")) ) ) ;;; creates the sun rays (define (rays) (arc_sun 60) (rt 200) (arc_sun 60) (rt 200) ) ;;; creates the sun (define (sun num) (cond ( (> num 0) (color_sun num) (rays) (rt 10) (sun (- num 1))) (else (pu)) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; CREATES THE FLOWER ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; chooses color (define (color_flower num) (cond ( (even? num) (color "mistyrose") ) ( else (color "pink") ) ) ) ;;; creates the petals (define (petal) (arc_flower 60) (rt 120) (arc_flower 60) (rt 120) ) ;;; creates flower (define (flower num) (cond ( (> num 0) (color_flower num) (begin_fill) (petal) (rt 20) (end_fill) (flower (- num 1))) (else (pu)) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; CREATES THE INNER FLOWER ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (color_oct num) (cond ( (= num 0) (color "SaddleBrown")) ( (even? num) (color "SaddleBrown") ) ( else (color "SandyBrown") ) ) ) ;;; helper for inner flower (define (inner num) (cond ( (> num 0) (fd 10) (rt 90) (fd 5) (lt 90) (fd 10) (rt 45) (inner (- num 1))) (else nil) ) ) ;;; helper for innerflower (define (octagon num) (speed 0) (cond ( (> num 0) (color_oct num) (begin_fill) (inner 8) (rt 36) (end_fill) (octagon (- num 1))) (else nil) ) ) ;;; creates the inner flower (define (oct_flower num) (speed 0) (cond ( (> num 0) (fd 30) (octagon 10) (bk 30) (rt 90) (pu) (fd 100) (lt 90) (pd) (oct_flower (- num 1))) (else nil)) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; CREATES THE CLOUDS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; helper for cloud (define (inner num) (cond ( (> num 0) (fd 10) (rt 90) (fd 5) (lt 90) (fd 10) (rt 45) (inner (- num 1))) (else nil) ) ) ;;; helper for cloud (define (cloud num) (speed 0) (cond ( (> num 0) (color "midnight blue") (begin_fill) (inner 8) (rt 36) (end_fill) (cloud (- num 1))) (else nil) ) ) ;;; creates the inner flower (define (oct_cloud num) (speed 0) (cond ( (> num 0) (fd 19) (cloud 10) (bk 30) (rt 90) (pu) (fd 100) (lt 90) (pd) (oct_cloud (- num 1))) (else nil)) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; MAIN FUNCTION: BEGINS HERE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (draw) (speed 0) ;;; set sky color (bgcolor "aliceblue") ;;; set clouds (pu) (setpos 170 230) (oct_cloud 3) ;;; create the landspace (pu) (setpos -680 20) (color "LightGreen") (pd) (begin_fill) (rt 90) (forward 1350) (right 90) (forward 1350) (right 90) (forward 1350) (right 90) (forward 1350) (right 90) (end_fill) (pu) ;;; create the sun (pu) (setpos -450 150) (pd) (sun 18) ;;; create stem of flower (pu) (setpos 80 -20) (rt 270) (pd) (color "dark green") (fd 300) ;;; create the flower (pu) (setpos 80 -20) (pd) (flower 18) ;;; create the inner flower (define (infinite_flower x_pos y_pos) (setpos x_pos y_pos) ) (setpos 80 -50) (pd) (rt 180) (oct_flower 1) ) ; Please leave this last line alone. You may add additional procedures above ; this line. nil ;;;<------ #REBEL WITHOUT A CAUSE! (draw)