Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
36
Task/Draw-a-clock/BBC-BASIC/draw-a-clock.basic
Normal file
36
Task/Draw-a-clock/BBC-BASIC/draw-a-clock.basic
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
CLS
|
||||
xp=320:yp=160:size=150
|
||||
CIRCLE xp, yp, size
|
||||
lasth=0:lastm=0:lasts=0
|
||||
hs=.25*size:ms=.45*size:ss=ms
|
||||
|
||||
FOR i=1 TO 12
|
||||
w=2*i*PI/12
|
||||
CIRCLE FILL xp+size*SIN(w), yp+size*COS(w),size/15
|
||||
NEXT
|
||||
|
||||
lasttime$ = TIME$
|
||||
WHILE TRUE
|
||||
IF lasttime$ <> TIME$ THENPROCclock:lasttime$=TIME$
|
||||
WAIT
|
||||
ENDWHILE
|
||||
|
||||
DEFPROCclock
|
||||
t$=TIME$
|
||||
h=VAL(MID$(t$,17,2))
|
||||
m=VAL(MID$(t$,20,2))
|
||||
s=VAL(MID$(t$,23,2))
|
||||
PRINT TAB(0,0);t$
|
||||
GCOL 0,0
|
||||
LINE xp, yp, xp+2*hs*SIN(lasth), yp+hs*COS(lasth)
|
||||
LINE xp, yp, xp+2*ms*SIN(lastm), yp+ms*COS(lastm)
|
||||
LINE xp, yp, xp+2*ss*SIN(lasts), yp+ss*COS(lasts)
|
||||
lasth=2*PI*(h/12+m/720)
|
||||
lastm=2*PI*m/60
|
||||
lasts=2*PI*s/60
|
||||
GCOL 0, 1
|
||||
LINE xp, yp, xp+2*hs*SIN(lasth), yp+hs*COS(lasth)
|
||||
LINE xp, yp, xp+2*ms*SIN(lastm), yp+ms*COS(lastm)
|
||||
GCOL 0, 2
|
||||
LINE xp, yp, xp+2*ss*SIN(lasts), yp+ss*COS(lasts)
|
||||
ENDPROC
|
||||
Loading…
Add table
Add a link
Reference in a new issue