Monday, February 20, 2012

KTurtle - Flower Power


Commands for Flower Power -


reset
repeat 360 {
repeat 180 {fw 1 tr .5}
tr 90
repeat 180 {fw 1 tr .5}
tr 95}

Sunday, February 19, 2012

KTurtle - Outwards Curly

Commands for Outwards Curly -


reset
repeat 4 {
for $x = 1 to 100 {
fw 10
tr $x}
tr 80}

KTurtle - Chaotic Circles

Commands for Chaotic Circles -


reset
repeat 72 {
repeat 4 {
fw 100
tr 90}
fw 5
tr 5}
repeat 72 {
repeat 4 {
fw 100
tl 90}
fw 5
tl 5}
tl 90
repeat 72 {
repeat 4 {
fw 100
tr 90}
fw 5
tr 5}
repeat 72 {
repeat 4 {
fw 100
tl 90}
fw 5
tl 5}
tr 90

KTurtle - Circles and Lines

Commands for Circles and Lines -

reset
repeat 36 {
repeat 4 {
fw 100
tr 45
repeat 36 {
fw 2
tl 10}
tr 45}
fw 4
tr 10}

KTurtle - Heighway Dragon

Commands for Heighway Dragon -


reset
canvassize 500, 500
go 320, 400
tr 90
$size = 7
learn X $depth {
if $depth>0 {
X $depth-1
tl 90
Y $depth-1
fw $size}}
learn Y $depth {
if $depth>0 {
fw $size
X $depth-1
tr 90
Y $depth-1}}
pencolor 0,255,0
fw $size
X 10
tl 90
pencolor 255,0,0
Y 10
fw $size
go 50,450

KTurtle - Sierpinski Triangle

Commands for Sierpinski Triangle-

learn sierp $l {
if $l > 2 {
repeat 3 {
sierp $l/2
fw $l
tl 120
}}}
reset
canvassize 600, 533
go 50, 483
tr 90
sierp 500

KTurtle - Koch Curve

Commands for Koch Curve -


reset
canvassize 850, 550
go 125, 350
tr 90
learn koch $x, $t {
if $t>0 {
$t=$t-1
$x=$x/3
koch $x, $t
tl 60
koch $x, $t
tr 120
koch $x, $t
tl 60
koch $x, $t
} else {
fw 3*$x }}
koch 200, 6