[looking for beta testers!!!] Clock program for 68k in BASIC
izder456 11 Mar 2019 15:12
I am working on a analog clock program in Ti-68k BASIC.
here is the code:
clock()
Prgm
“Setup Code”
StoGDB a
ClrDraw
ClrIO
ClrHome
FnOff
setGraph(“axes”,”off”)
“Set Window”
1.3->xmax
1.3->ymax
⁻1.3->xmin
⁻1.3->ymin
ZoomSqr
setMode(“Angle”,”RADIAN”)
“Draw Clock Base”
Circle 0,0,1
PtText “12”,⁻.15,1.2
PtText “6”,⁻.08,⁻1.05
PtText “9”,⁻1.2,.08
PtText “3”,1.05,.08
“Draw 3 hour,5 minute, and 1 minute tick marks”
For b,0,60*π/30,π/30
Line .925*cos(b),.925*sin(b),cos(b),sin(b)
EndFor
For b,0,12*π/6,π/6
Line .85*cos(b),.85*sin(b),cos(b),sin(b)
EndFor
For b,0,4*π/2,π/2
Line .8*cos(b),.8*sin(b),cos(b),sin(b)
EndFor
“Draw Hands”
While getKey()=0
getTime()->l1
l1[1]->h
l1[2]->m
Line 0,0,.5*sin((h-1)*π/6),.5*cos((h-1)*π/6),0
Line 0,0,.5*sin(h*π/6),.5*cos(h*π/6),1
Line 0,0,.7*sin((h-1)*π/30),.7*cos((h-1)*π/30),0
Line 0,0,.7*sin(h*π/30),.7*cos(h*π/30),1
EndWhile
FnOn
RclGDB a
EndPrgm
I am accepting all criticism, constructive mainly, or improvements.
Thanks ahead of time
programmable with a whole twelve lines!