时钟:
to dz
stampoval 100 100
repeat 12[pu fd 95 pd fd 5 pu bk 100 rt 360/12 pd]
end
to sz :s :f :m
if :m>59 then make "f :f+1 make "m 0
if :f>59 then make "s :s+1 make "f 0
if :s>11 then make "s 0
dz
rt :m*6 fd 90 bk 90 lt :m*6
rt :f*6 fd 70 bk 70 lt :f*6
rt :s*30 fd 50 bk 50 lt :s*30
wait 100 cs
sz :s :f :m+1
end
执行:sz 时 分 秒
红绿灯:
TO HLD
LT 90 PU FD 100 RT 90
HONG
RT 90 PU FD 100 LT 90
HUANG
RT 90 PU FD 100 LT 90
LV
LT 90 PU FD 100 RT 90
HUANG
HLD
END
TO HONG
PD SETPC 12
(STAMPOVAL 60 60 "TRUE)
WAIT 300 PE
(STAMPOVAL 60 60 "TRUE)
PD
END
TO HUANG
PD SETPC 14
(STAMPOVAL 60 60 "TRUE)
WAIT 100 PE
(STAMPOVAL 60 60 "TRUE)
PD
END
TO LV
PD SETPC 10
(STAMPOVAL 60 60 "TRUE)
WAIT 300 PE
(STAMPOVAL 60 60 "TRUE)
PD
END
这百分百的能!
to hx :c :r
if :r>360*10 then stop
fd :c rt :r
hx :c :r+10
end
to lxx :b :j
if :b>200 [stop]
fd :b rt :j
lxx :b+2 :j
end
to rd :x
draw lt 180 fd :x-10 repeat 2[lt 120 fd :x+50]
lt 120 fd :x-10 rt 90 repeat 3[fd :x+10 lt 90]
end
to dz
stampoval 100 100
repeat 12[pu fd 95 pd fd 5 pu bk 100 rt 360/12 pd]
end
to sz :s :f :m
if :m>59 then make "f :f+1 make "m 0
if :f>59 then make "s :s+1 make "f 0
if :s>11 then make "s 0
dz
rt :m*6 fd 90 bk 90 lt :m*6
rt :f*6 fd 70 bk 70 lt :f*6
rt :s*30 fd 50 bk 50 lt :s*30
wait 100 cs
sz :s :f :m+1
end
to a1 :b :c
setpc :c
repeat 36[rt 5 fd :b*0.174 rt 5]
pu rt 90 fd 5 pd fill
pu bk 5 lt 90 pd
end
to b1
a1 10 1 wait 50 a1 10 0
end
to c1
repeat 36[b1 pu fd 100*0.174 rt 10 pd]
end
to tx
setbg 0
a1 40 4
pu lt 90 fd 60 rt 90 pd
c1
end
to c
label "l
if button? 1 then pd else pu
setxy mouse
if not button? 2 then go "l
end