Advertisement
Guest User

Untitled

a guest
Jul 10th, 2010
1,013
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. kturtle-script-v1.0
  2. # This script creates a leaf
  3. # It is an example of an
  4. # "iterated function system"
  5. # You can find out more at
  6. # http://en.wikipedia.org/wiki/Iterated_function_system
  7.  
  8. @(reset)
  9. @(canvassize) 500@(,)500
  10. @(pencolor) 0@(,)255@(,)0
  11.  
  12. $p=0
  13. $q=0
  14.  
  15. # you can change the number of iterations
  16. # also change the maps if you like
  17. @(repeat) 60000 {
  18. $p1 = @(random) 0@(,)255
  19. $p2 = @(random) 0@(,)255
  20. $p3 = @(random) 0@(,)30
  21. # random pen color that is close to green
  22. @(pencolor) $p1@(,)$p2@(,)$p3
  23. $x = @(random) 1@(,)100
  24. $pt = $p
  25. $qt = $q
  26. @(if) $x < 86 {
  27. $p=0.85*$pt+0.04*$qt
  28. $q=-0.04*$pt+0.85*$qt+1.6
  29. }
  30. @(if) ($x >= 86) @(and) ($x < 93) {
  31. $p=-0.15*$pt+0.28*$qt
  32. $q=0.26*$pt+0.24*$qt+0.44
  33. }
  34. @(if) ($x >=93) @(and) ($x < 99) {
  35. $p=0.2*$pt-0.26*$qt
  36. $q=0.23*$pt+0.22*$qt+1.6
  37. }
  38. @(if) ($x >= 99) {
  39. $p=0
  40. $q=0.16*$qt
  41. }
  42. @(go) (50*$p+200)*1@(,) 500-(50*($q))
  43. @(pendown)
  44. @(forward) 1
  45. @(penup)
  46. @(backward) 1
  47. }
  48.  
  49. @(go) 0@(,)0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement