Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
32
Task/Draw-a-clock/AmigaBASIC/draw-a-clock.basic
Normal file
32
Task/Draw-a-clock/AmigaBASIC/draw-a-clock.basic
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
xp=320:yp=95:size=150
|
||||
CIRCLE (xp,yp),size,,,,.5
|
||||
lasth=0:lastm=0:lasts=0
|
||||
hs=.25*size:ms=.45*size:ss=ms
|
||||
pi=3.141592
|
||||
|
||||
FOR i=1 TO 12
|
||||
w=2*i*pi/12
|
||||
CIRCLE (xp+size*SIN(w),yp+size/2*COS(w)),size/15
|
||||
NEXT
|
||||
|
||||
ON TIMER(1) GOSUB Clock
|
||||
TIMER ON
|
||||
|
||||
loop: GOTO loop
|
||||
|
||||
Clock:
|
||||
t$=TIME$
|
||||
h=VAL(MID$(t$,1,2))
|
||||
m=VAL(MID$(t$,4,2))
|
||||
s=VAL(MID$(t$,7,2))
|
||||
LOCATE 1,1:PRINT t$
|
||||
LINE (xp,yp)-(xp+2*hs*SIN(lasth),yp-hs*COS(lasth)),0
|
||||
LINE (xp,yp)-(xp+2*ms*SIN(lastm),yp-ms*COS(lastm)),0
|
||||
LINE (xp,yp)-(xp+2*ss*SIN(lasts),yp-ss*COS(lasts)),0
|
||||
lasth=2*pi*(h/12+m/720)
|
||||
lastm=2*pi*m/60
|
||||
lasts=2*pi*s/60
|
||||
LINE (xp,yp)-(xp+2*hs*SIN(lasth),yp-hs*COS(lasth)),1
|
||||
LINE (xp,yp)-(xp+2*ms*SIN(lastm),yp-ms*COS(lastm)),1
|
||||
LINE (xp,yp)-(xp+2*ss*SIN(lasts),yp-ss*COS(lasts)),2
|
||||
RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue