home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Game Killer
/
Game_Killer.bin
/
075.CLOCK.BAS
< prev
next >
Wrap
BASIC Source File
|
1979-12-31
|
4KB
|
94 lines
100 REM
110 REM Digital Clock and Alarm
120 REM Copyright (c) 1990
130 REM by Randy Hawkins and ONE THOUSAND Magazine
140 REM All Rights Reserved
150 REM
155 COMMON RH: IF RH = 0 THEN SYSTEM
160 SCREEN 1: KEY OFF: COLOR 0,1: CLS
170 DIM A(255), B(255), C(255), D(255), E(255)
180 DIM F(255), G(255), H(255), I(255), J(255), K(255)
190 LOCATE 20,12: PRINT "One Moment Please"
200 REM
210 REM Store Pictures of Digits in Arrays A-K
220 REM
230 A$ = "O": GOSUB 960: GET (140,50)-(172,120),A
240 A$ = "1": GOSUB 960: GET (140,50)-(172,120),B
250 A$ = "2": GOSUB 960: GET (140,50)-(172,120),C
260 A$ = "3": GOSUB 960: GET (140,50)-(172,120),D
270 A$ = "4": GOSUB 960: GET (140,50)-(172,120),E
280 A$ = "5": GOSUB 960: GET (140,50)-(172,120),F
290 A$ = "6": GOSUB 960: GET (140,50)-(172,120),G
300 A$ = "7": GOSUB 960: GET (140,50)-(172,120),H
310 A$ = "8": GOSUB 960: GET (140,50)-(172,120),I
320 A$ = "9": GOSUB 960: GET (140,50)-(172,120),J
330 A$ = ":": GOSUB 960: GET (140,50)-(172,120),K
340 REM
350 REM Prepare Screen for Clock, then Check for Keypress
360 REM
370 CLS: LINE (0,30)-(319,140),1,BF: LINE (20,45)-(299,125),0,BF
380 LOCATE 21,10: PRINT "Press <A> to Set Alarm"
390 LOCATE 23,13: PRINT "or <ESC> to Exit"
400 REM
410 REM Display Time and Check Keystrokes
420 REM
430 GOSUB 780: IF TIME$ = ALARM$ THEN 730
440 K$ = INKEY$: IF K$ = "" THEN 430
450 IF K$ = CHR$(27) THEN SCREEN 0: WIDTH 80
452 IF K$ = CHR$(27) THEN LOCATE 12,30
454 IF K$ = CHR$(27) THEN PRINT "One Moment Please": RUN "menu"
460 IF K$ <> "A" AND K$ <> "a" THEN 430
470 REM
480 REM Set Alarm Time
490 REM
500 HR = 12: MN = 0: LOCATE 21,10: PRINT STRING$(22,32)
510 LOCATE 22,9: PRINT "Use < and > to set hour,"
520 LOCATE 23,9: PRINT CHR$(27); " and "; CHR$(26);
530 PRINT CHR$(32);"to set minutes,": LOCATE 24,7
540 PRINT "press ENTER to set the alarm.";
550 ALARM$ = "": IF HR < 10 THEN ALARM$ = "0"
560 ALARM$ = ALARM$ + MID$(STR$(HR),2) + ":"
570 IF MN < 10 THEN ALARM$ = ALARM$ + "0"
580 ALARM$ = ALARM$ + MID$(STR$(MN),2) + ":00"
590 LOCATE 20,10: PRINT "Alarm Set at "; ALARM$
600 K$ = INKEY$: IF K$ = "" THEN GOSUB 780: GOTO 600
605 IF K$ = CHR$(27) THEN 450
610 REM
620 REM Adjustments to Alarm Setting
630 REM
640 IF K$ = "<" OR K$ = "," THEN HR = HR - 1 - 24 * (HR = 0)
650 IF K$ = ">" OR K$ = "." THEN HR = HR + 1 + 24 * (HR = 23)
660 IF K$ = CHR$(0) + "K" THEN MN = MN - 1 - 60 * (MN = 0)
670 IF K$ = CHR$(0) + "M" THEN MN = MN + 1 + 60 * (MN = 59)
680 IF K$ <> CHR$(13) THEN 550 ELSE FOR A = 22 TO 24
690 LOCATE A,5: PRINT STRING$(32,32);: NEXT A: GOTO 430
700 REM
710 REM Sound the Alarm
720 REM
730 WHILE INKEY$ = "": PLAY "L8CC": GOSUB 780
740 WEND: ALARM$ = "": GOTO 370
750 REM
760 REM Use TIME$ to Display Correct Time
770 REM
780 IF A$ = TIME$ THEN RETURN ELSE A$ = TIME$
790 FOR A = 0 TO 7: B = ASC(MID$(A$,A+1,1)) - 47
800 ON B GOSUB 820,830,840,850,860,870,880,890,900,910,920
810 NEXT A: RETURN
820 PUT (A*33+26,50),A,PSET: RETURN
830 PUT (A*33+26,50),B,PSET: RETURN
840 PUT (A*33+26,50),C,PSET: RETURN
850 PUT (A*33+26,50),D,PSET: RETURN
860 PUT (A*33+26,50),E,PSET: RETURN
870 PUT (A*33+26,50),F,PSET: RETURN
880 PUT (A*33+26,50),G,PSET: RETURN
890 PUT (A*33+26,50),H,PSET: RETURN
900 PUT (A*33+26,50),I,PSET: RETURN
910 PUT (A*33+26,50),J,PSET: RETURN
920 PUT (A*33+26,50),K,PSET: RETURN
930 REM
940 REM Draw Digit in A$ Using Graphics
950 REM
960 LOCATE 1,1: PRINT A$: FOR B = 0 TO 6: FOR C = 0 TO 7
970 LINE (140+C*4,50+B*10)-(144+C*4,60+B*10),POINT(C,B),BF
980 NEXT C,B: RETURN