Guest User

Untitled

a guest
Jan 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (load-file "turtle.clj")
  2. (in-ns 'turtle)
  3.  
  4. (defn fib [turtle depth lenght]
  5. (forward turtle lenght)
  6. (if (> depth 2)
  7. (do
  8. (left turtle 80)
  9. (fib turtle (- depth 1) (/ lenght 1.4))
  10. (right turtle 160)
  11. (fib turtle (- depth 1) (/ lenght 1.4))
  12. (left turtle 80)))
  13. (back turtle lenght))
  14.  
  15. (let [turtle (turtle 400 400)]
  16. (pen-up turtle)
  17. (go turtle 0 -100)
  18. (pen-down turtle)
  19. (fib turtle 9 120)
  20. (show turtle)
  21. (write turtle "tree.png"))
Add Comment
Please, Sign In to add comment