home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar - Compleat Programmer
/
comprog1.d81
/
b.calendar
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-28
|
3KB
|
128 lines
10 poke53280,0:poke53281,0:print"[147]"
20 poke650,128:rem all keys repeat
22 poke788,52:rem disable stop
30 dimm$(13),ml(13),d$(8)
40 fori=0to11:readm$(i),ml(i):next
50 data" [202]anuary ",31
60 data"[198]ebruary ",28
70 data" [205]arch ",31
80 data" [193]pril ",30
90 data" [205]ay ",31
100 data" [202]une ",30
110 data" [202]uly ",31
120 data" [193]ugust ",31
130 data"[211]eptember",30
140 data" [207]ctober ",31
150 data"[206]ovember ",30
160 data"[196]ecember ",31
170 fori=0to6:readd$(i):next
180 data" [211]unday "
190 data" [205]onday "
200 data" [212]uesday "
210 data"[215]ednesday"
220 data"[212]hursday "
230 data" [198]riday "
240 data"[211]aturday "
250 bx$(0)="[176][192][192][192][192][192][192][192][192][192][174][157][221][157][157][157][157][157][157][157][157][157][157][157][221][157][173][192][192][192][192][192][192][192][192][192][189]
260 bx$(1)[178]"ortantantantan^cmd(NULL)cmdcmdcmdcmdcmdcmd(NULL)cmd/tantantantanexp"
270 bx$(2)[178]"ortantantantantantan^cmd(NULL)cmdcmdcmdcmdcmdcmdcmdcmd(NULL)cmd/tantantantantantanexp"
280 bx$(3)[178]bx$(0)
282 h[178]100:f[178]400
290 y[178]4:[129]i[178]0[164]3:[135]x(i):[130]
300 [131]1,12,19,28:[143] tabs for boxes
307 :
308 :[143] screen
309 :
310 [153]"loadfor (NULL)left$val (NULL)right$chr$left$(NULL)(NULL) (NULL)(NULL)atnstr$(NULL)(NULL)atn(NULL) str$atn(NULL) lenatn(NULL)len(NULL)(NULL)atn(NULL)(NULL)(NULL)
320 print"[154] [205]onth [196]ate [217]ear [196]ay"
330 print"[155] [195][210][211][210] [210][201][199][200][212]/[204][197][198][212][152] - [205]ove box
340 b[178]8:[153][163]b)"list len(NULL)(NULL)(NULL) (NULL)(NULL)print# - ascorward
350 printtab(b)"[155][195][210][211][210] [196][207][215][206][152] - [194]ack
360 [153][163]b)"list asc1print# - (NULL)ear back 10
370 printtab(b)"[155] [198]2[152] - [217]ear forward 10
380 [153][163]b)"list asc3print# - (NULL)ear back 100
390 printtab(b)"[155] [198]4[152] - [217]ear forward 100
410 [153][163]b)"list (NULL)print# - (NULL)uit
420 fori=0to3:poke214,y:print"":printtab(x(i))bx$(i):next
430 x=0:y0=0:y1=1:y2=1994:dw=6:rem starting values
440 poke214,y+1:print"[159]"
450 printtab(x(0)+1)m$(y0)
460 poke214,y+1:print
470 printtab(x(1)+1)" [157][157][157]"str$(y1)
480 poke214,y+1:print
490 printtab(x(2)+1)str$(y2)
492 gosub820
497 :
498 :rem get loop
499 :
500 poke214,y:print:printtab(x(x))""bx$(x):rem highlight
510 geta$:ifa$=""then510
520 ifa$<>"[157]"anda$<>""then570
530 poke214,y:print:printtab(x(x))""bx$(x):rem de-highlight
540 ifa$=""thenx=x+1:ifx>2thenx=0:rem right
550 ifa$="[157]"thenx=x-1:ifx<0thenx=2:rem left
560 goto500
567 :
568 :rem down
569 :
570 ifa$<>""then650
580 onx+1goto590,610,630
590 y0=y0-1:ify0<0theny0=11
592 ify0=1thenify1>28theny1=28
600 goto440
610 y1=y1-1:ify1<1theny1=ml(y0)-((y0=1)and(y2/4=int(y2/4)))
612 ify2/h=int(y2/h)thenify2/f<>int(y2/f)thenify0=1andy1=29theny1=y1-1
620 goto440
630 y2=y2-1:ify2<1584theny2=1584:rem earliest date
637 :
638 :rem up
639 :
640 goto440
650 ifa$<>"[145]"then730
660 onx+1goto670,690,710
670 y0=y0+1:ify0>11theny0=0
672 ify0=1thenify1>28theny1=28
680 goto440
690 y1=y1+1:ify1>ml(y0)-((y0=1)and(y2/4=int(y2/4)))theny1=1
692 ify2/h=int(y2/h)thenify2/f<>int(y2/f)thenify0=1andy1=29theny1=1
700 goto440
710 y2=y2+1:ify2>9999theny2=9999
720 goto440
727 :
728 :rem f-keys
729 :
730 ifa$<chr$(133)ora$>chr$(138)then800
750 ifa$=chr$(133)theny2=y2-10:ify2<1584theny2=1584
760 ifa$=chr$(137)theny2=y2+10:ify2>9999theny2=9999
770 ifa$=chr$(134)theny2=y2-h:ify2<1584theny2=1584
780 ifa$=chr$(138)theny2=y2+h:ify2>9999theny2=9999
790 goto440
800 ifa$="q"then990:rem quit
802 goto440
807 :
808 :rem calculate
809 :
820 ny=y2-1584:rem # of years
830 nl=int(ny/4)-int((y2-1500)/h)+int((y2-1200)/f):rem # of leap yrs
840 nd=ny*365+nl+1:rem # of days
850 if(y2-1200)/f=int((y2-1200)/f)then880:rem is year 1600,2000,2400?
860 if(y2-1500)/h=int((y2-1500)/h)then890:rem is year 1700,1800,1900?
870 ify2/4<>int(y2/4)then890:rem leap year?
880 ify0<2thennd=nd-1:rem before feb 29?
890 nq=0:ify0thenfori=0toy0-1:nq=nq+ml(i):next
900 nq=nq+y1-1:nd=nd+nq:rem # of days including current year
910 dq=int(nd/7):dw=nd-dq*7:rem modulo to get # of day of week
920 poke214,y+1:print:printtab(x(3)+1)d$(dw)
922 return
960 goto520
987 :
988 :rem return to ls
989 :
990 poke788,49:rem re-enable stop
992 a$="hello connect":fori=8to9:close2:open2,i,2:close2:ifstthen1010
1000 close15:open15,i,15,"r0:"+a$+"="+a$:input#15,er:close15:ifer=63then1020
1010 next:print"[147]":poke2048,0:poke44,8:poke53272,23:poke186,8:end
1020 poke646,peek(53281):print"[147]load"chr$(34)a$chr$(34)","i
1030 print"run":poke44,8:poke2048,0:poke631,13:poke632,13:poke198,2:end
10000 open15,8,15,"s0:b.calendar":close15:save"b.calendar",8:end