aUCBLogo Demos and Tests / turtlestest2
to axis
fd 100 label "y bk 100 rt 90
fd 100 label "x bk 100 up 90
fd 100 label "z bk 100 label "o
end
to cube
repeat 4[repeat 4[fd 50 rt 90] fd 50 down 90]
end
to turtlesTest2
cs perspective
n=9
t=array n
savet=turtle
repeat n
[ t.repcount=newTurtle
setturtle t.repcount
setpc hsb repcount*360/n 1 1
]
repeat 1
[ repeat n
[ setturtle t.repcount
ht rt repcount*40 pu fd 150 pd axis cube pu
]
if key?
[ repeat n
[ setturtle t.repcount
ht
]
setturtle t.repcount
box
stop
]
]
end
to turtlesTest3
cs perspective
n=9
t=array n
savet=turtle
repeat n
[ t.repcount=newTurtle
setturtle t.repcount
setpc hsb repcount*360/n 1 1
]
repeat 1
[ repeat n
[ setturtle t.repcount
;;; seth 0 is the differrece;;;
ht rt repcount*40 pu fd 150 pd seth 0 axis
cube pu
]
if key?
[ repeat n
[ setturtle t.repcount
ht
]
setturtle t.repcount
box
stop
]
]
end