CodeBase - 12-hour clock

Return to the CodeBase listing

Category: Complete Applications

Version: 1.0

0
0

Information

Uploaded: 13th Jul 2004 15:50

Modified: 1st Jan 1970 01:00

Author:  Sven B

Summary

12-hour clock... lots and lots of cos() and sin().

Full Description

12-hour clock coded by Sven Boulanger(age: 14 , Place: Belgium , date 14/07/04)<br /> Its not that good, but for me it's a start. I'm trying...<br /> <br /> without ` or rem :<br /> <br /> sync on<br /> <br /> hide mouse<br /> white=rgb(255,255,255)<br /> red=rgb(255,0,0)<br /> blue=rgb(0,0,255)<br /> yellow=rgb(255,255,0)<br /> clockx=320<br /> clocky=240<br /> do<br /> cls<br /> time$=get time$()<br /> hours=val(mid$(time$,1))*10+val(mid$(time$,2))<br /> minutes=val(mid$(time$,4))*10+val(mid$(time$,5))<br /> seconds=val(mid$(time$,7))*10+val(mid$(time$,8))<br /> ink white,0<br /> circle 320,240,100<br /> for m=1 to 60<br /> x=cos(360/60*m)*95<br /> y=sin(360/60*m)*95<br /> dot clockx+x,clocky+y<br /> next m<br /> for h=1 to 12<br /> x=cos(360/12*h)*95<br /> y=sin(360/12*h)*95<br /> box clockx+x-1,clocky+y-1,clockx+x+1,clocky+y+1<br /> next h<br /> ink yellow,0<br /> hourx=cos(360/12*hours-90)*65<br /> houry=sin(360/12*hours-90)*65<br /> line clockx,clocky,clockx+hourx,clocky+houry<br /> ink blue,0<br /> minutex=cos(360/60*minutes-90)*75<br /> minutey=sin(360/60*minutes-90)*75<br /> line clockx,clocky,clockx+minutex,clocky+minutey<br /> ink red,0<br /> secondx=cos(360/60*seconds-90)*93<br /> secondy=sin(360/60*seconds-90)*93<br /> line clockx,clocky,clockx+secondx,clocky+secondy<br /> set cursor 10,20 : print time$<br /> sync<br /> loop

Comments

No comments yet.