Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (load-file "turtle.clj")
- (in-ns 'turtle)
- (defn fib [turtle depth lenght]
- (forward turtle lenght)
- (if (> depth 2)
- (do
- (left turtle 80)
- (fib turtle (- depth 1) (/ lenght 1.4))
- (right turtle 160)
- (fib turtle (- depth 1) (/ lenght 1.4))
- (left turtle 80)))
- (back turtle lenght))
- (let [turtle (turtle 400 400)]
- (pen-up turtle)
- (go turtle 0 -100)
- (pen-down turtle)
- (fib turtle 9 120)
- (show turtle)
- (write turtle "tree.png"))
Add Comment
Please, Sign In to add comment