Advertisement
Guest User

Untitled

a guest
Jul 10th, 2010
500
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. kturtle-script-v1.0
  2. # Mandelbrot set
  3. @(reset)
  4. $size = 50
  5. @(canvassize) $size@(,) $size
  6. @(direction) 90
  7. $i=0
  8. $j=0
  9. $aorg=0
  10. $borg=0
  11. $a=0
  12. $b=0
  13. $temp=0
  14. $cnt=0
  15. $shift = @(round) ($size/4)
  16. @(while) $i < $size {
  17. $j=0
  18. @(while) $j < $size {
  19. $aorg = (($i-$shift)*2/$size)-1
  20. $borg = (($j)*2/$size)-1
  21. $a=0
  22. $b=0
  23. $cnt = 0
  24. @(while) $cnt <= 255 @(and) $a*$a+$b*$b < 4 {
  25. $temp = $a*$a - $b*$b + $aorg
  26. $b = 2*$a*$b + $borg
  27. $a = $temp
  28. $cnt = $cnt + 1
  29. }
  30. $cnt = 256-$cnt
  31. @(pencolor) $cnt@(,) $cnt@(,) $cnt
  32. @(go) $i@(,) $j
  33. @(forward) 1
  34. $j = $j + 1
  35. }
  36. $i = $i + 1
  37. }
  38. @(go) 0@(,)0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement