home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
genie-commodore-file-library
/
C64Software
/
ARROW-CLOCK
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
2KB
|
45 lines
205 INPUT"YEAR(XX),MONTH(XX),DATE(XX)";Y,M,D
206 POKE172,Y:POKE171,M:POKE170,D
220 POKE53280,0:POKE53281,0:POKE646,1
230 Y=PEEK(172)+1900:M=PEEK(171):D=PEEK(170)
240 PRINT"[147]"
250 REM FIGURE OUT DAY OF WEEK/MOON PHASE/JULIAN DATE
260 Q=Y+(M<3):J=INT(275*M/9)-INT((7*Q+7)/4)+367*Y+D-INT((INT(Q/100)+1)*3/4)
270 DV=J-4-7*INT((J-4)/7):IFF1=0THENF1=1:DU=DV+1:P=J:P1=D:D=1:M1=M:M=1:GOTO260
280 M=M1:D=P1:REM M AND D WERE CHANGED TO MONTH 1 AND DAY 1 TO GET JUL DAY
290 POKE646,1:PI=P/29.530588+.2:PH=PI-(INT(PI)):P2=INT(PH*100)+1:REM MOON PHASE
300 PRINT" SUN MON TUE WED THU FRI SAT"
310 POKE1105+(DU*6-5),30
320 PRINT:PRINT" JAN FEB MAR APR MAY JUN
330 [139]M[179][178]6[167][151]1225[170](M[172]6[171]5),30
340 [153]:[153]:[153]" JUL AUG SEP OCT NOV DEC
350 IFM>6THENM1=M:M=M-6:POKE1345+(M*6-5),30:M=M1
360 PRINT:PRINT
370 M1$=" 1111111111222222222233
380 M2$[178]"1234567890123456789012345678901
390 MP$=" .<<<<[[[[[209][209][209][209]]]]]>>>>. "
400 IFM=1ORM=3ORM=5ORM=7ORM=8ORM=10ORM=12THENA=31:GOTO450
410 A=30:IFM<>2THEN450:REM NOT FEBRUARY
420 IF(YAND3)THENA=28:GOTO450 :REM NOT LEAP YEAR
430 A=29:IFY/100<>INT(Y/100)THEN450:REM NOT CENTURY YEAR
440 IFY/400<>INT(Y/400)THENA=28:REM CENTURY YR/LEAP YR/BUT NOT DIVISIBLE BY 400
450 PRINT" "LEFT$(M1$,A):PRINT" "LEFT$(M2$,A)
460 POKE1504+D,30
470 PRINT:PRINT:PRINT" JULIAN "(P-J)+1;:REMP=JUL DATE
21536 ODAY. J=JAN 1 OF YEAR
475 DL=P-J+1:
480 PRINT" WEEK"INT((DL/365)*52)+1
485 IFFG=1THENPH$="N":GOTO490
486 PH$=MID$(MP$,INT(P2/4),1)
490 PRINT:PRINT" MOON PHASE ";PH$
500 T$=LEFT$(TI$,2)+":"+MID$(TI$,3,2)+":"+RIGHT$(TI$,2):IFTI$="000000"THEN530
520 PRINT"":FORL=1TO16:PRINT:NEXT:PRINT" TIME- ";T$;:GOTO500
530 D=D+1:IFD<=ATHEN560
540 D=1:M=M+1:IFM<=12THEN560
550 M=1:Y=Y+1
560 POKE49152,D:POKE49153,M:POKE49154,Y-1900:CLR
570 D=PEEK(49152):M=PEEK(49153):Y=1900+PEEK(49154)
580 TY$=TI$
590 IFTY$=TI$THEN590
610 PRINT"[147]":GOTO250