home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1993 June
/
1993-06.d64
/
usr prt clock.bb
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
1KB
|
40 lines
40 printchr$(147):poke53281,14:poke646,6
50 print"set clock at:"
60 r=8:gosub290:k=43200
70 ifi$="pm"thenx=k
80 fori=1to3:h=int(t(i)/10):l=t(i)-10*h:t(i)=16*h+l:next
90 c=56331:pokec,t(1):pokec-1,t(2):pokec-2,t(3)
100 print"activate user port at:"
110 r=18:gosub290
120 ifi$="pm"theny=k
130 b=y+t(1)*3600+t(2)*60+t(3)
140 print"press any key to start clock.
150 [161]a$:[139]a$[178]""[167]150
160 [151]c[171]3,0
170 h[178][194](c):m[178][194](c[171]1):s[178][194](c[171]2):t[178][194](c[171]3)
180 c1$[178][199]((16[175]h)[173]16[170]48)[170][199]((15[175]h)[170]48)
190 h[178][197](c1$)[172]3600
200 [139]c1$[178]"00"[167]c1$[178]"12"
210 c2$[178][199]((240[175]m)[173]16[170]48)[170][199]((15[175]m)[170]48):m[178][197](c2$)[172]60
220 c3$[178][199]((240[175]s)[173]16[170]48)[170][199]((15[175]s)[170]48):s[178][197](c3$)
230 a[178]x[170]h[170]m[170]s:[139]a[178]2[172]k[167][151]c,0:[151]c[171]3,0:x[178]0
240 [139]a[178]b[167]420
250 [139]a[179]k[167]j$[178]"am":[137]270
260 j$[178]"pm"
270 [153]"time is "c1$[170]":"[170]c2$[170]":"[170]c3$[170]":"t;j$[170]"on"
280 [137]170
290 h$[178]"":[133]"hours";h$:[139]h$[179]"0"[176]h$[177]"9"[167][153]"onon":[137]290
300 t(1)[178][197](h$):[139]t(1)[179]0[176]t(1)[177]12[167][153]"onon":[137]290
310 [139]t(1)[178]12[167]t(1)[178]0
320 m$[178]"":[133]"minutes";m$:[139]m$[179]"0"[176]m$[177]"9"[167][153]"ononon":[137]320
330 t(2)[178][197](m$):[139]t(2)[179]0[176]t(2)[177]59[167][153]"ononon":[137]320
340 s$[178]"":[133]"seconds";s$:[139]s$[179]"0"[176]s$[177]"9"[167][153]"ononon":[137]340
350 t(3)[178][197](s$):[139]t(3)[179]0[176]t(3)[177]59[167][153]"ononon":[137]340
360 [153]"am or pm (press a or p)"
370 [161]i$:[139]i$[179][177]"a"[167][139]i$[179][177]"p"[167]370
380 [139]i$[178]"a"[167]i$[178]"am":[137]400
390 i$[178]"pm"
400 [151]214,r:[153]:[151]211,24:[153]i$
410 [142]
420 [153]"loaduser port activated."