home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
commodore-users-of-norman
/
CUON_02_(08-1984).d64
/
calendar.c3
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
10KB
|
332 lines
1 GOTO910
2 REM ** ML STOP KEY DISABLE **
3 PRINT"x[169]=[141][169][141]X` [234][255][169][255][133][145]L4[234]x[169]1[141][169][234][141]X`
4 [153]"xhhh+hNOThhhhhhhPRINT#HRUNHX`111"
5 [153]"hhhhhhh`1"
6 [143] ** 4 - POP ML SUBROUTINE **
10 [143] **GENERAL INPUT ROUTINE **
15 :
30 :
35 [143] +++ INPUT SECTION +++
40 [151]UO,0:UR$[178]"":UI$[178]""
42 [139]UL[178]0[167]UL[178]80
45 [153]" CMDCMD";:[151]UC,0
50 [161]UI$:[139]UI$[178]""[167]50
55 [139]UI$[178][199](13)[175][195](UR$)[177][178]1[167][151]UC,1:[153]" CMD";:[137]85
60 [139]UI$[178][199](20)[167]105
62 [139] [195](UR$)[178][177]UL[167]50
65 [141]120:[143] CHECK FOR VALID CHARACTER
70 UR$[178]UR$[170]UI$
75 [153]UI$;
80 [137]50
85 [143] +++ CHECK FOR HELP REQUEST +++
90 [139]UR$[178]UX$[167]195:[143] EXIT TO HELP ROUTINE
95 [139]UF[178]1[167][141]240
100 UF[178]0:[153]:[142]
102 [143] ++ CHECK DELETE ++
105 [139][195](UR$)[179]1[167]50
110 UR$[178][200](UR$,[195](UR$)[171]1)
115 [153]"CMD CMDCMD";:[137]50
120 [143] ++ CHECK FOR VALID CHARACTERS ++
125 [139][195](US$)[178]0[167]150
127 US$[178]US$[170]UX$
130 [129]US[178]1[164][195](US$)
135 [139]UI$[178][202](US$,US,1)[167][142]
140 [130]
145 UI$[178]"":[142]
150 [143] ** STANDARD INPUT **
152 [139][198](UI$)[178]46[167][142]
155 [139]UI$[178][199](32)[167][142]
160 [139][198](UI$)[179]48[176][198](UI$)[177]57[167]170
165 [142]
170 [139][198](UI$)[179]65[176][198](UI$)[177]90[167]180
175 [142]
180 [139][198](UI$)[179]193[176][198](UI$)[177]218[167]UI$[178]"":[142]
185 [139][194](UT)[178]UU%[167]UI$[178][199]([198](UI$)[171]128):[142]
187 [142]
190 UI$[178]"":[142]
195 UF[178]1:[143] +++ HELP ROUTINE EXIT +++
197 [141]250
200 [141]245
205 [129]UQ[178]UB[164](U2%[172]256[170]U1%[170]U3%[171]2)
210 UQ%(UQ[171]UB)[178][194](UQ):[130]:[153]"LOAD"
215 UZ[178]1:UV%[178][194](UT)
216 [137]300
217 UZ[178]0:US$[178]UJ$:UG$[178]UK$:UP[178]UJ:UL[178]UK
218 [139][194](50003)[178]0[167][151]53281,1:[153]"LOAD";:[151]53281,6:[151]53280,14:[137]220
219 [153]"LOAD";
220 UT$[178]UL$:[151]UT,UV%:[129]UQ[178]UB[164](U2%[172]256[170]U1%[170]U3%[171]3)
225 [151]UQ,UQ%(UQ[171]UB):[130]
230 [151]U1,U1%
232 [151]U2,U2%
233 [151]U4,U4%
234 [151]U3,U3%[171]1
235 [137]35
240 UD%[178]((U2%[172]256[170]U1%[170]U3%)[171]UB)[173]40:[153][200](UD$,UD%[170]1):[142]
245 [153][200](UD$,24);" HELP COMING WAIT ":[142]
250 U1%[178][194](U1):U2%[178][194](U2):U3%[178][194](U3):U4%[178][194](U4)
251 UJ$[178]US$:UK$[178]UG$:UL$[178]UT$:UJ[178]UP:UK[178]UL
255 [142]
300 [143] ** MENU **
301 :
302 [153]"LOAD":[151]UT,UU%:[139][194](50003)[178]0[167][151]53281,9:[151]53280,8
303 :
305 [153]" MENU"
310 [153]" --------------------------------------"
315 [153]" 1. BEGIN CALENDAR "
320 [153]" 2. USER INSTRUCTIONS"
335 [153]" 3. QUIT"
340 [153]" --------------------------------------"
345 [153]" PRESS A NUMBER KEY (1-3) ";
350 UL[178]1:US$[178]"123":[141]35:[143] INPUT ROUTINE
352 US$[178]""
355 [145][197](UR$)[141]1000,400,396
360 [137]300
395 [143] ** RE-ENABLE STOP KEY AND END **
396 [139][194](50003)[179][177]1[175][194](50003)[179][177]160[175][194](50003)[179][177]0[167]399
397 [158]UU[170]71:[139][194](50003)[178]0[167][151]53281,6:[151]53280,14
398 [153]"CONTLOAD":[128]
399 [141]875:[142]
400 [143] ** STUDENT INSTRUCTIONS **
405 [153]"LOAD":[151]UT,UL%
410 UG$[178]"(null)SER RIGHT$NSTR.":UP[178]0:[141]850
433 [153]" (null)HIS IS ACLOSELENALENDARCLOSEPROGRAM WITHCLOSEWHICH"
435 [153]" YOUCLOSECANCLOSESEECLOSEANYCLOSEYEAR'SCLOSE& ANYCLOSEMONTH'S"
437 [153]" LENALENDAR. (null)HENCLOSEASKEDCLOSECLOSEFORCLOSETHECLOSEYEAR,"
439 [153]" ENTERCLOSEITCLOSEASCLOSEACLOSEFOURCLOSEDIGITCLOSENUMBER."
440 [153]" VAL.CHR$. 1982WAIT"
441 [153]" (null)HENCLOSEASKEDCLOSEFORCLOSETHECLOSEMONTH, ENTERCLOSEIT"
442 [153]" EITHER INCLOSEWORDSCLOSEORCLOSEINCLOSENUMBERS RIGHT$.VAL.:"
443 [153]" (null)HISCLOSEPROGRAM WILL ONLY WORK ACCURATELY"
444 [153]" FOR YEARS AFTER 1752."
445 [141]835:[141]850
451 [153]" * MID$ATN(null)(null)ATN(null)(null) (null)(null) 1";" ";
453 [153]"* MID$(null)(null)(null) (null)(null) 7";
455 [153]" * ASCVALPEEK(null)(null)ATN(null)(null) (null)(null) 2";" ";
457 [153]"* ATN(null)CHR$(null)(null)(null) (null)(null) 8";
459 [153]" * (null)ATN(null)LENLEFT$ (null)(null) 3";" ";
461 [153]"* (null)VAL(null)(null)VAL(null)PEEKVAL(null) (null)(null) 9";
463 [153]" * ATN(null)(null)RIGHT$(null) (null)(null) 4";" ";
465 [153]"* (null)LEN(null)(null)PEEKVAL(null) (null)(null) 10";
467 [153]" * (null)ATN(null) (null)(null) 5";" ";
469 [153]"* (null)(null)(null)VAL(null)PEEKVAL(null) (null)(null) 11";
471 [153]" * MID$(null)(null)VAL (null)(null) 6";" ";
473 [153]"* STR$VALLENVAL(null)PEEKVAL(null) (null)(null) 12";
477 [153]" RIGHT$FCLOSEYOUCLOSEWANTCLOSETHECLOSEWHOLECLOSEYEAR'SCLOSECALENDAR"
479 [153]" THENCLOSEENTERCLOSEFORCLOSETHECLOSEMONTH ATN(null)(null)WAIT."
481 [153]" VALNTERCLOSEYOURCLOSEMONTHCLOSEINCLOSEFULLCLOSEIFCLOSEYOUCLOSEENTER"
482 [153]" IT ASCLOSEACLOSEWORD."
485 [141]835:[141]850
500 [153]"(null)(null)(null)VAL: ATNLWAYSCLOSEPRESSCLOSETHECLOSE<(null)VAL(null)(null)(null)(null)> KEY"
502 [153]" AFTERCLOSEENTERINGCLOSEANCLOSEANSWER."
503 [153]" RIGHT$FCLOSEATCLOSEANYCLOSETIMECLOSEYOUCLOSEWOULDCLOSELIKECLOSETOCLOSEGO"
505 [153]" BACKCLOSETOCLOSETHECLOSE(null)VAL(null)(null),ENTER LEFT$ <(null)VAL(null)(null)(null)(null)>."
510 [141]835:[141]850
530 [153]" (null)O THE BEST OF OUR KNOWLEDGE,"
532 [153]" THIS PROGRAM IS IN THE PUBLIC"
534 [153]" DOMAIN. RIGHT$F THIS IS NOT THE CASE"
536 [153]" PLEASE CONTACT:"
538 [153]" LENOMMODORE PEEKUSINESS (null)ACHINES"
540 [153]" 3370 (null)HARMACY ATNVE.
542 PRINT" [193]GINCOURT, [207]NTARIO"
544 PRINT" [195]ANADA [205]1[215] 2[203]4"
546 PRINT" (416) 499-4292"
548 GOSUB 835:GOSUB 850
550 PRINT" [208]ROGRAM [206]AME: [195]ALENDAR
552 [153]" (null)RITTEN PEEKY : (null). (null). (null)AMEKI
554 PRINT" [213]PGRADED [194]Y :
556 [153]" (null)HIS PROGRAM WILL RUN ON ANY
562 PRINT" [208][197][212] 64 [195][207][205][208][213][212][197][210]
564 [153]" LEN(null)(null)(null)(null)STR$(null)(null)VAL 64 LEN(null)(null)(null)(null)(null)VAL(null)
566 GOSUB835
590 IFUZ=1THENSYS1115:GOTO217
599 RETURN
700 REM ** TO USE 8032 LOAD CBM4032 **
710 PRINT"[147]BEFORE RUNNING THIS PROGRAM ON AN 8032
720 [153]" LOAD THE 'CBM 4032' PROGRAM"
730 [158]UU[170]71
740 [128]
800 [143] ** T I T L E P A G E **
802 [153]"LOAD";:[151]UT,UU%:[139][194](50003)[178]0[167][151]53280,14:[151]53281,6
804 [129]I[178]1[164]38:[153]"SPC(WAIT";:[130]
806 [129]I[178]1[164]22:[153]"CMDSPC(WAIT";:[130]
808 [129]I[178]1[164]37:[153]"CMDCMDSPC(WAIT";:[130]
810 [129]I[178]1[164]22:[153]"ONCMDSPC(WAIT";:[130]
812 [153]"STEP WAIT
814 PRINT" [146] [146][169]
816 [153]" WAIT TAB((null)
818 PRINT"[223] [146]
820 [153]"C O M M O D O R E
822 PRINT"EDUCATIONAL
824 [153]"SOFTWARE
826 REM ** COMMODORE LOGO **
827 PRINTLEFT$(UD$,24);"PRESS SPACE BAR OR WAIT[146]":I=0
828 GETA$:IFA$<>" "THENI=I+1:IFI<250THEN828
830 T1$="":T2$="":T3$="":T4$="":I=0
832 GOTO300
835 REM ** SPACE BAR PRESS **
840 POKEUO,0:PRINTLEFT$(UD$,24);"PRESS SPACE BAR TO CONTINUE[146]"
844 GETUI$:IFUI$<>" "THEN844
846 RETURN
850 REM ** PAGE DESIGN ROUTINE **
852 UP=UP+1
855 PRINT"[147]"LEFT$(UT$+UP$,21);RIGHT$(UP$+UG$,18)
860 PRINT" --------------------------------------"
864 IFUH<>0THEN870
865 PRINTLEFT$(UD$,24);LEFT$(UP$,7);"HELP - PRESS H <RETURN>"
870 UH=0:PRINT"":RETURN
875 REM ** PLEASE WAIT REMARK **
880 PRINTLEFT$(UD$,24);" ONE MOMENT PLEASE... "
885 RETURN
900 REM ** SET UP VARIABLES **
901 UX$="H":DIMUQ%(1000):UB=32768:U1=196:U2=197:U3=198:U4=216:UC=167:UU=1024
902 UT=59468:UU%=12:UL%=14:UP%=1146:UM=32768:UO=158:POKE 50003,0
903 IFPEEK(50003)=0THENUB=1024:U1=209:U2=210:U3=211:U4=214:UC=204:UU=2048
904 IFPEEK(50003)=0THENUT=53272:UU%=21:UL%=23:UP%=2139:UM=1024:UO=198
905 UD$=""
906 UP$=" "
907 UT$=" [195][193][204][197][206][196][193][210] [160][160][160][160][160]":REM PLACE PROGRAM TITLE HERE !!!!!!!!!!!!!!!!!***
908 RETURN
910 REM ** SET VARIABLES **
915 GOSUB900
920 REM ** CHECK FOR 8032 **
925 PRINT"[147]":PRINT"[160]":REM SHIFTED SPACE
930 IFPEEK(UB+40)<>96THENGOSUB700
931 REM ** MEMORY CHECK **
932 IF FRE(0)>2000THEN937
933 PRINT"[147]THIS MACHINE DOES NOT HAVE ENOUGH"
934 PRINT"MEMORY TO RUN THIS PROGRAM !"
935 SYSUU+71
936 END
937 PRINT"[147]":IFPEEK(50003)=0THEN962
940 REM ** BASIC 2.0 OR 4.0 OR C-64 SETUP **
941 POKE1075,133:POKE1076,144:POKE1077,234:POKE1079,4:POKE1080,133:POKE1081,145
942 POKE1091,155:POKE1098,133:POKE1099,144:POKE1100,234:POKE1103,133
943 POKE1104,145:POKE1105,234:POKE1082,234
945 IFPEEK(50003)<>160THEN955
950 POKE1093,88:POKE1094,228:POKE1097,85:POKE1102,228:GOTO965
955 IFPEEK(50003)<>1THEN990
960 POKE1093,49:POKE1094,230:POKE1097,46:POKE1102,230:GOTO965
962 POKE2099,141:POKE2100,20:POKE2101,3:POKE2103,8:POKE2104,141:POKE2105,21
963 POKE2106,3:POKE2115,145:POKE2117,52:POKE2118,234:POKE2121,49:POKE2122,141
964 POKE2123,20:POKE2124,3:POKE2126,234:POKE2127,141:POKE2128,21:POKE2129,3
965 SYSUU+48:REM DISABLE STOP KEY
970 GOSUB800:REM TITLE
980 GOTO300:REM MENU
990 PRINT"[147]THE PGM WILL NOT WORK ON THIS MACHINE!":END
1000 IFUZ=1THENSYSUP%:SYSUP%:UZ=0:REM ** PROGRAM STARTS HERE **
1001 PRINT"[147]";:RESTORE:IFPEEK(50003)=0THENPOKE53281,6:POKE53280,14
1020 REM COPYRIGHT OSCAR NAOYUKI NAMEKI
1030 REM CALENDAR
1040 REM COLUMBIA COLLEGE
1050 REM 1619 W10 AVE VANCOUVER BC
1060 POKEUT,UL%:W=1:UG$="":UP=1:GOSUB850:PRINT"":GOSUB2030
1070 PRINT"[145][145]";
1080 PRINT "[193] [208][197][210][208][197][212][213][193][204] [195][193][204][197][206][196][193][210]":GOSUB835
1100 UH=1:UP=UP+1:GOSUB850
1120 PRINT" [215]HAT[160]YEAR'S[160]CALENDAR[160]DO[160]YOU[160]WANT? [157][157][157][157]";
1125 US$="-0123456789":UL=4:GOSUB35:A=VAL(UR$)
1126 IF A<1752 THEN 1120
1130 B=(A/100):C=INT(A/100):D=B-C
1140 REM--CALCULATION OF LEAP YEAR
1150 IF D=0 THEN 1190
1160 B=(A/4):C=INT(A/4):D=B-C
1170 IF D=0 THEN 1230
1180 GOTO 1250
1190 B=(A/400):C=INT(A/400):D=B-C
1200 IF D=0 THEN 1230
1210 GOTO 1250
1230 PRINT" [207]H! [212]HIS[160]IS[160]A[160]LEAP[160]YEAR."
1240 X=1:GOTO 1260
1250 X=0
1260 F=INT(A/4):G=INT(A/400):H=INT(A/100)
1270 J=F+G-H
1280 L=(A+J)/7:M=INT((A+J)/7):Q=(L-M)*7:O=INT(Q):R=Q-O
1290 IF R>0.9 THEN O=O+1
1300 O=O-X
1310 IF O<0 THEN O=O+7
1330 PRINT" [215]HAT[160]IS[160]THE[160]MONTH? ";
1335 US$="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ":UL=8:GOSUB35:B$=UR$
1350 GOSUB2520
1360 PRINTCHR$(147)
1370 IF B$="ALL" THEN A$="ALL"
1380 IF B$="JANUARY" OR B$="1" OR A$="ALL" THEN GOSUB 1900
1390 IF B$="FEBRUARY"OR B$="2" OR A$="ALL" THEN GOSUB 1910
1400 IF B$="MARCH" OR B$="3" OR A$="ALL" THEN GOSUB 1920
1410 IF B$="APRIL" OR B$="4" OR A$="ALL" THEN GOSUB 1930
1420 IF B$="MAY" OR B$="5" OR A$="ALL" THEN GOSUB 1940
1430 IF B$="JUNE" OR B$="6" OR A$="ALL" THEN GOSUB 1950
1440 IF B$="JULY" OR B$="7" OR A$="ALL" THEN GOSUB 1960
1450 IF B$="AUGUST" OR B$="8" OR A$="ALL" THEN GOSUB 1970
1460 IF B$="SEPTEMBER"OR B$="9" OR A$="ALL" THEN GOSUB 1980
1470 IF B$="OCTOBER" OR B$="10" OR A$="ALL" THEN GOSUB 1990
1480 IF B$="NOVEMBER" OR B$="11" OR A$="ALL" THEN GOSUB 2000
1490 IF B$="DECEMBER" OR B$="12" OR A$="ALL" THEN GOSUB 2010
1500 UH=1:UG$="":UP=UP+1:GOSUB850
1510 PRINT" [193]NOTHER CALENDAR? ";
1520 US$="YN":UL=1:GOSUB35:C$=UR$
1540 IF C$="Y"THEN UP=0:GOTO1100
1550 CLR:GOSUB900:GOSUB300
1560 END
1570 IF Z>6 THEN Z=Z-7
1580 IF Z<0 THEN Z=Z+7
1620 REM WRITING CALENDAR
1630 W=20:GOSUB2020
1640 PRINT"";"";
1650 A=INT(A)
1660 PRINT TAB(3);B$,TAB(20);A
1670 PRINT"";TAB(3);"[211][213][206][160][160][205][207][206][160][160][212][213][197][160][160][215][197][196][160][160][212][200][213][160][160][198][210][201][160][160][211][193][212]"
1680 PRINT"";
1690 FOR K=0 TO 5
1700 L=(K*7)+1:M=L+6
1710 FOR N=L TO M
1720 P=N-Z
1730 IF P<=0 THEN 1820
1740 IF N>7 THEN Z1=N-(7*K):GOTO 1760
1750 Z1=N
1760 IF P>9 THEN 1780
1770 I=(5*Z1)-2:GOTO 1790
1780 I=(5*Z1)-3
1790 IF P>Y THEN 1860
1800 IF P=Q THEN PRINT TAB(I);"";P:PRINT:PRINT "[145][145][145]":GOTO 1820
1810 PRINT TAB(I);P;
1820 NEXT N
1830 PRINT
1840 PRINT
1850 NEXT K
1860 PRINT
1870 GOSUB835:RETURN
1900 Z=O :Y=31 :B$="[202][193][206][213][193][210][217]" :GOSUB 1570:RETURN
1910 Z=O+3 :Y=28+X :B$="[198][197][194][210][213][193][210][217]" :GOSUB 1570:RETURN
1920 Z=O+3+X :Y=31 :B$="[205][193][210][195][200]" :GOSUB 1570:RETURN
1930 Z=O-1+X :Y=30 :B$="[193][208][210][201][204]" :GOSUB 1570:RETURN
1940 Z=O+1+X :Y=31 :B$="[205][193][217]" :GOSUB 1570:RETURN
1950 Z=O+4+X :Y=30 :B$="[202][213][206][197]" :GOSUB 1570:RETURN
1960 Z=O-1+X :Y=31 :B$="[202][213][204][217]" :GOSUB 1570:RETURN
1970 Z=O+2+X :Y=31 :B$="[193][213][199][213][211][212]" :GOSUB 1570:RETURN
1980 Z=O+5+X :Y=30 :B$="[211][197][208][212][197][205][194][197][210]" :GOSUB 1570:RETURN
1990 Z=O+X :Y=31 :B$="[207][195][212][207][194][197][210]" :GOSUB 1570:RETURN
2000 Z=O+3+X :Y=30 :B$="[206][207][214][197][205][194][197][210]" :GOSUB 1570:RETURN
2010 Z=O+5+X :Y=31 :B$="[196][197][195][197][205][194][197][210]" :GOSUB 1570:RETURN
2020 PRINT"[147]"
2030 PRINT"[167][163]";
2040 FOR C=1 TO 35
2050 PRINT "[163]";
2060 NEXT C
2070 PRINT"[163][165]"
2080 FOR C=1 TO W
2090 PRINT TAB(0);"[167]";TAB(38);"[165]"
2100 NEXT C
2110 PRINT "[167][164]";
2120 FOR C=1 TO 35
2130 PRINT "[164]";
2140 NEXT C
2150 PRINT "[164][165]"
2160 RETURN
2520 PRINT" [196]O YOU WANT A MARKER ON A DATE? ";
2530 US$="YN":UL=1:GOSUB35:V$=UR$
2550 IFV$="N" THEN GOTO2620
2560 PRINT" [207]N WHAT DAY OF THE MONTH? ";
2570 US$="0123456789":UL=2:GOSUB35:Q=VAL(UR$)
2620 RETURN