home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 5
/
005.d81
/
biorhythm
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
3KB
|
111 lines
5 dim a(12)
10 print"[147]"
30 rem bio rhythm program
50 dim a$(38),b$(38),c$(38),n$(50)
110 rem enter name & age
130 print:print:print"what is your name ";:input n$
170 print:print:print "when is your birthday (mo,da,yr) ",:input m1,d1,y1
210 print:print
230 if y1<=99 then 250
240 y1=y1-1900
250 m=m1:d=d1:y=y1
280 gosub 1330
290 b1=k:goto 420
320 rem bad entry
340 print"bio-rhythms can only be computed"
350 print"for years between 1980 & 1999":print
370 print"please enter mo & yr again":goto 440
400 rem enter date of bio
420 print "what month, year do you want your"
430 print "bio-rhythm to begin? (mo,yr)";
440 input m2,y2:print:print
480 rem test for good date
500 if y2<80 or y2>1999 then 340
510 if y2<=99 then 540
520 if y2>99 and y2<1980 then 340
530 y2=y2-1900
540 m=m2:d=1:y=y2:gosub 1330
580 s1=k:gosub1450
610 rem print chart
630 e=s1-b1
640 open 4,4
670 print#4,"bio-rhythm analysis for ";n$
680 print#4," ":print#4," ";
710 gosub 1170 rem print mo.
800 print#4,y2:print#4," "
850 print#4," down critical up"
860 gosub 1170
880 print#4,"--------------------------------------"
890 d6=a(m2)
900 if m2=2 then gosub 1650
910 for i=1 to d6
920 print#4,i;
930 a$=" : "
940 j=33:gosub 1420
960 a$=left$(a$,y-1)+"i"+mid$(a$,y+1)
970 b$=a$:j=28:gosub1420
1000 b$=left$(b$,y-1)+"e"+mid$(b$,y+1)
1010 c$=b$:j=23:gosub 1420
1020 if i<=9 then print#4," ";
1040 c$=left$(c$,y-1)+"p"+mid$(c$,y+1):print#4,c$
1060 e=e+1:next i
1120 m4=m4-1:m2=m2+1
1130 if m4<=0 then 1780
1140 gosub 1570
1145 print#4," ":print#4," ":print#4," "
1147 gosub 1570
1150 goto 670
1170 rem print chart month
1190 if m2=1 then print#4,"jan.";
1200 if m2=2 then print#4,"feb.";
1210 if m2=3 then print#4,"mar.";
1220 if m2=4 then print#4,"apr.";
1230 if m2=5 then print#4,"may.";
1240 if m2=6 then print#4,"jun.";
1250 if m2=7 then print#4,"jul.";
1260 if m2=8 then print#4,"aug.";
1270 if m2=9 then print#4,"sep.";
1280 if m2=10 then print#4,"oct.";
1290 if m2=11 then print#4,"nov.";
1300 if m2=12 then print#4,"dec.";
1310 return
1330 rem compute julian date
1350 if m>2 then 1390
1360 m3=m+13:y=y-1:goto 1400
1390 m3=m+1
1400 k=int(365.25*y)+int(30.6001*m3)+d
1410 return
1420 y=int(12*sin(6.28318*e/j)+18.5)
1430 return
1450 rem read in days of the month
1470 : rem dimmed already - ln. #5
1480 data 31,28,31,30,31,30,31,31,30,31,30,31
1490 d6=0
1500 for i=1 to 12
1510 read a:a(i)=a:next i
1530 print"for how many months do you":print"want your bio-rhythm ";
1540 input m4
1550 print:print
1570 if m2<13 then 1600
1580 m2=m2-12:y2=y2+1
1600 if m2=2 then gosub 1650
1605 print"[144]please turn your printer on-line"
1606 print"press a key to print.":poke198,0:wait198,1
1610 return
1630 rem is it leap year?
1650 le=y2-80
1660 if le>19 then 340
1670 if le/4-int(le/4)<.1 then 1730
1700 return
1730 d6=29
1740 return
1750 y2=y2+1:m2=m2-12
1770 return
1780 for i=1 to 8:print#4," ":next i
1790 print#4:close 4
1800 print"like to try another?"
1805 poke198,0:wait198,1:getk$:ifk$<>"y"andk$<>"n"then1805
1810 ifk$="y"thenrestore:print"[147]":goto110
1900 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
1910 poke631,13:poke632,13:poke198,2:end