Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- kturtle-script-v1.0
- # Mandelbrot set
- @(reset)
- $size = 50
- @(canvassize) $size@(,) $size
- @(direction) 90
- $i=0
- $j=0
- $aorg=0
- $borg=0
- $a=0
- $b=0
- $temp=0
- $cnt=0
- $shift = @(round) ($size/4)
- @(while) $i < $size {
- $j=0
- @(while) $j < $size {
- $aorg = (($i-$shift)*2/$size)-1
- $borg = (($j)*2/$size)-1
- $a=0
- $b=0
- $cnt = 0
- @(while) $cnt <= 255 @(and) $a*$a+$b*$b < 4 {
- $temp = $a*$a - $b*$b + $aorg
- $b = 2*$a*$b + $borg
- $a = $temp
- $cnt = $cnt + 1
- }
- $cnt = 256-$cnt
- @(pencolor) $cnt@(,) $cnt@(,) $cnt
- @(go) $i@(,) $j
- @(forward) 1
- $j = $j + 1
- }
- $i = $i + 1
- }
- @(go) 0@(,)0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement