10 '   c l o c k routine
15 DEFINT A-Z
20 DIM N$(11,4), DOW(6,8), MODY(11), AL$(26,4)
22 X$ = DATE$
23 IF RIGHT$(X$,2) < "83" THEN GOSUB 4000
40 N$(0,0) = "01110": N$(1,0) = "00100": N$(2,0) = "01110": N$(3,0) = "11110"
50 N$(0,1) = "10001": N$(1,1) = "01100": N$(2,1) = "10001": N$(3,1) = "00001"
60 N$(0,2) = "10001": N$(1,2) = "00100": N$(2,2) = "00010": N$(3,2) = "00110"
70 N$(0,3) = "10001": N$(1,3) = "00100": N$(2,3) = "01000": N$(3,3) = "00001"
80 N$(0,4) = "01110": N$(1,4) = "01110": N$(2,4) = "11111": N$(3,4) = "11110"
90 N$(4,0) = "00010": N$(5,0) = "11111": N$(6,0) = "01110": N$(7,0) = "11111"
100 N$(4,1) = "00110": N$(5,1) = "10000": N$(6,1) = "10000": N$(7,1) = "00001"
110 N$(4,2) = "01010": N$(5,2) = "11110": N$(6,2) = "11110": N$(7,2) = "00010"
120 N$(4,3) = "11111": N$(5,3) = "00001": N$(6,3) = "10001": N$(7,3) = "00100"
130 N$(4,4) = "00010": N$(5,4) = "11110": N$(6,4) = "01110": N$(7,4) = "00100"
140 N$(8,0) = "01110": N$(9,0) = "01110": N$(10,0) = "00000":N$(11,0) = "00000"
150 N$(8,1) = "10001": N$(9,1) = "10001": N$(10,1) = "00100":N$(11,1) = "00000"
160 N$(8,2) = "01110": N$(9,2) = "01111": N$(10,2) = "00000":N$(11,2) = "01110"
170 N$(8,3) = "10001": N$(9,3) = "00001": N$(10,3) = "00100":N$(11,3) = "00000"
180 N$(8,4) = "01110": N$(9,4) = "01110": N$(10,4) = "00000":N$(11,4) = "00000"
190 AL$(0,0) = "  A  ": AL$(1,0) = "BBBB ": AL$(2,0) = " CCCC"
200 AL$(0,1) = " A A ": AL$(1,1) = "B   B": AL$(2,1) = "C    "
210 AL$(0,2) = "A   A": AL$(1,2) = "BBBB ": AL$(2,2) = "C    "
220 AL$(0,3) = "AAAAA": AL$(1,3) = "B   B": AL$(2,3) = "C    "
230 AL$(0,4) = "A   A": AL$(1,4) = "BBBB ": AL$(2,4) = " CCCC"
240 AL$(3,0) = "DDDD ": AL$(4,0) = "EEEEE": AL$(5,0) = "FFFFF"
250 AL$(3,1) = "D   D": AL$(4,1) = "E    ": AL$(5,1) = "F    "
260 AL$(3,2) = "D   D": AL$(4,2) = "EEE  ": AL$(5,2) = "FFF  "
270 AL$(3,3) = "D   D": AL$(4,3) = "E    ": AL$(5,3) = "F    "
280 AL$(3,4) = "DDDD ": AL$(4,4) = "EEEEE": AL$(5,4) = "F    "
290 AL$(6,0) = " GGGG": AL$(7,0) = "H   H": AL$(8,0) = " III "
300 AL$(6,1) = "G    ": AL$(7,1) = "H   H": AL$(8,1) = "  I  "
310 AL$(6,2) = "G  GG": AL$(7,2) = "HHHHH": AL$(8,2) = "  I  "
320 AL$(6,3) = "G   G": AL$(7,3) = "H   H": AL$(8,3) = "  I  "
330 AL$(6,4) = " GGG ": AL$(7,4) = "H   H": AL$(8,4) = " III "
340 AL$(9,0) = " JJJ ": AL$(10,0) = "K   K": AL$(11,0) = "L    "
350 AL$(9,1) = "  J  ": AL$(10,1) = "K  K ": AL$(11,1) = "L    "
360 AL$(9,2) = "  J  ": AL$(10,2) = "KK   ": AL$(11,2) = "L    "
370 AL$(9,3) = "J J  ": AL$(10,3) = "K K  ": AL$(11,3) = "L    "
380 AL$(9,4) = " J   ": AL$(10,4) = "K  K ": AL$(11,4) = "LLLLL"
390 AL$(12,0) = "M   M": AL$(13,0) = "N   N": AL$(14,0) = " OOO "
400 AL$(12,1) = "MM MM": AL$(13,1) = "NN  N": AL$(14,1) = "O   O"
410 AL$(12,2) = "M M M": AL$(13,2) = "N N N": AL$(14,2) = "O   O"
420 AL$(12,3) = "M   M": AL$(13,3) = "N  NN": AL$(14,3) = "O   O"
430 AL$(12,4) = "M   M": AL$(13,4) = "N   N": AL$(14,4) = " OOO "
440 AL$(15,0) = "PPPP ": AL$(16,0) = " QQQ ": AL$(17,0) = "RRRR "
450 AL$(15,1) = "P   P": AL$(16,1) = "Q   Q": AL$(17,1) = "R   R"
460 AL$(15,2) = "PPPP ": AL$(16,2) = "Q   Q": AL$(17,2) = "RRRR "
470 AL$(15,3) = "P    ": AL$(16,3) = "Q Q Q": AL$(17,3) = "R R  "
480 AL$(15,4) = "P    ": AL$(16,4) = " QQQQ": AL$(17,4) = "R  R "
490 AL$(18,0) = " SSSS": AL$(19,0) = "TTTTT": AL$(20,0) = "U  U "
500 AL$(18,1) = "S    ": AL$(19,1) = "  T  ": AL$(20,1) = "U  U "
510 AL$(18,2) = " SSS ": AL$(19,2) = "  T  ": AL$(20,2) = "U  U "
520 AL$(18,3) = "    S": AL$(19,3) = "  T  ": AL$(20,3) = "U  U "
530 AL$(18,4) = "SSSS ": AL$(19,4) = "  T  ": AL$(20,4) = " UU U"
540 AL$(21,0) = "V   V": AL$(22,0) = "W   W": AL$(23,0) = "X   X"
550 AL$(21,1) = "V   V": AL$(22,1) = "W   W": AL$(23,1) = " X X "
560 AL$(21,2) = "V   V": AL$(22,2) = "W W W": AL$(23,2) = "  X  "
570 AL$(21,3) = " V V ": AL$(22,3) = "WW WW": AL$(23,3) = " X X "
580 AL$(21,4) = "  V  ": AL$(22,4) = "W   W": AL$(23,4) = "X   X"
590 AL$(24,0) = "Y   Y": AL$(25,0) = "ZZZZZ": AL$(26,0) = "     "
600 AL$(24,1) = " Y Y ": AL$(25,1) = "   Z ": AL$(26,1) = "     "
610 AL$(24,2) = "  Y  ": AL$(25,2) = "  Z  ": AL$(26,2) = "     "
620 AL$(24,3) = "  Y  ": AL$(25,3) = " Z   ": AL$(26,3) = "     "
630 AL$(24,4) = "  Y  ": AL$(25,4) = "ZZZZZ": AL$(26,4) = "     "
640 FOR I = 0 TO 11
650  READ MODY(I)
660 NEXT
670 DATA 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304,334
675 DATA 5,17,8,3,0,24,26,26,26
680 DATA 18,0,19,20,17,3,0,24,26
690 DATA 18,20,13,3,0,24,26,26,26
700 DATA 12,14,13,3,0,24,26,26,26
710 DATA 19,20,4,18,3,0,24,26,26
720 DATA 22,4,3,13,4,18,3,0,24
730 DATA 19,7,20,17,18,3,0,24,26
750 FOR I = 0 TO 6
760 FOR J = 0 TO 8
770    READ DOW(I,J)
780 NEXT J,I
790 FOR I = 0 TO 26
800  FOR J = 0 TO 4
810   FOR K = 1 TO 5
820    IF MID$(AL$(I,J),K,1) <> " " THEN MID$(AL$(I,J),K,1) = CHR$(178)
830 NEXT K,J,I
2000 KEY OFF
2010 FOR I = 0 TO 11
2020 FOR J = 0 TO 4
2030 FOR K = 1 TO 5
2040 IF MID$(N$(I,J),K,1) = "0" THEN MID$(N$(I,J),K,1) = " " ELSE MID$(N$(I,J),K,1) = CHR$(178)
2050 NEXT K,J,I
2060 CLS
2070 K$= TIME$
2080 D1 = VAL(MID$(K$,1,1))
2090 D2 = VAL(MID$(K$,2,1))
2100 D3 = VAL(MID$(K$,4,1))
2110 D4 = VAL(MID$(K$,5,1))
2120 D5 = VAL(MID$(K$,7,1))
2130 D6 = VAL(MID$(K$,8,1))
2140 LOCATE 1,1,0
2150 FOR I = 0 TO 4
2160 PRINT N$(D1,I);" ";N$(D2,I);N$(10,I);N$(D3,I);" ";N$(D4,I);N$(10,I);N$(D5,I);" ";N$(D6,I)
2170 NEXT
2180 K$= DATE$
2190 IF K$ = OLDDT$ GOTO 3000 ELSE OLDDT$ = K$
2200 D1 = VAL(MID$(K$,1,1))
2210 D2 = VAL(MID$(K$,2,1))
2220 D3 = VAL(MID$(K$,4,1))
2230 D4 = VAL(MID$(K$,5,1))
2240 D5 = VAL(MID$(K$,7,1))
2250 D6 = VAL(MID$(K$,8,1))
2260 D7 = VAL(MID$(K$,9,1))
2270 D8 = VAL(MID$(K$,10,1))
2280 LOCATE 19,1,0
2290 FOR I = 0 TO 4
2300 PRINT N$(D1,I);" ";N$(D2,I);N$(11,I);N$(D3,I);" ";N$(D4,I);N$(11,I);N$(D5,I);" ";N$(D6,I);" ";N$(D7,I);" ";N$(D8,I)
2310 NEXT
2320 MON = VAL(LEFT$(K$,2))
2330 DAY = VAL(MID$(K$,4,2))
2340 YEAR = VAL(RIGHT$(K$,4))
2350 NDYS = MODY(MON-1) + DAY
2360 IF YEAR MOD 4 = 0 AND YEAR MOD 200 <> 0 AND MON > 2 THEN NDYS = NDYS + 1
2370 DW = NDYS MOD 7
2380 LOCATE 8,1
2390 FOR I = 0 TO 4
2400 FOR J = 0 TO 8
2410  PRINT AL$(DOW(DW,J),I);" ";
2420 NEXT J
2430 PRINT
2440 NEXT I
3000 A$ = INKEY$: IF A$="" THEN 2070
3005 CLS
3010 SYSTEM
3020 END
4000 CLS: LOCATE 1,1,1: PRINT "DATE AND TIME NEED TO BE INITIALIZED PLEASE ENTER:"
4010 INPUT "DATE (IN MM-DD-YY FORM):";X$
4020 DATE$ = X$
4030 PRINT: INPUT "TIME (IN HH-MM[-SS] FORM (SECONDS OPTIONAL)):",X$
4040 A = INSTR(X$,"-")
4050 H$ = LEFT$(X$,A-1)
4060 IF LEN(X$) > 5 THEN B = INSTR(A+1,X$,"-"): M$ = MID$(X$,A+1,(B - (A+1))):  S$ = RIGHT$(X$,(LEN(X$)-B)) ELSE M$ = RIGHT$(X$,(LEN(X$)- A)): S$ = "00"
4070 X$ = H$ + ":" + M$ + ":" + S$
4080 PRINT X$
4090 TIME$ = X$
4100 RETURN