Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- load-file "turtle.clj")
- (in-ns 'turtle)
- (defn boom [turtle len depth]
- (loop [i 0]
- (if (= i 0)
- (forward turtle len))
- (:else
- (forward turtle (* i 0.8 len)))
- (if (> depth 1)
- (do (left turtle 80)
- (boom turtle (- depth 1))
- (right turtle 160)
- (boom turtle (- depth 1))
- (left turtle 80)))
- (if (= i 0)
- (back turtle len))
- (:else
- (back turtle (* i 0.8 len)))
- (recur (inc i))))
- (let [turtle (turtle 400 400)]
- (pen-up turtle)
- (go turtle 0 -100)
- (pen-down turtle)
- (boom turtle 10 5)
- (show turtle))
Add Comment
Please, Sign In to add comment