La lancetta viene aggiornata ogni secondo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
Turtle.Speed=10 xc=GraphicsWindow.Width/2 yc=GraphicsWindow.Height/2 r =yc*0.8 s =Clock.Second While "true" sn=Clock.Second If(s <> sn) Then s=sn Turtle.Angle=6*s GraphicsWindow.PenColor=GraphicsWindow.GetRandomColor() Turtle.X=xc Turtle.Y=yc Turtle.PenDown() Turtle.Move(r) Turtle.PenUp() EndIf EndWhile |
Secondi in analogico e digitale…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
Turtle.Speed=10 xc=GraphicsWindow.Width/2+80 yc=GraphicsWindow.Height/2 r =yc*0.8 s =Clock.Second While "true" sn=Clock.Second If(s <> sn) Then s=sn Turtle.Angle=6*s c=GraphicsWindow.GetRandomColor() GraphicsWindow.PenColor =c GraphicsWindow.BrushColor=c GraphicsWindow.DrawText(10+16*Math.Remainder(s,10),10+16*Math.Floor(s/10),s) Turtle.X=xc Turtle.Y=yc Turtle.PenDown() Turtle.Move(r) Turtle.PenUp() EndIf EndWhile |