home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 5 / 005.d81 / biorhythm (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  3KB  |  111 lines

  1. 5 dim a(12)
  2. 10 print"[147]"
  3. 30 rem bio rhythm program
  4. 50 dim a$(38),b$(38),c$(38),n$(50)
  5. 110 rem enter name & age
  6. 130 print:print:print"what is your name ";:input n$
  7. 170 print:print:print "when is your birthday (mo,da,yr) ",:input m1,d1,y1
  8. 210 print:print
  9. 230 if y1<=99 then 250
  10. 240 y1=y1-1900
  11. 250 m=m1:d=d1:y=y1
  12. 280 gosub 1330
  13. 290 b1=k:goto 420
  14. 320 rem bad entry
  15. 340 print"bio-rhythms can only be computed"
  16. 350 print"for years between 1980 & 1999":print
  17. 370 print"please enter mo & yr again":goto 440
  18. 400 rem enter date of bio
  19. 420 print "what month, year do you want your"
  20. 430 print "bio-rhythm to begin? (mo,yr)";
  21. 440 input m2,y2:print:print
  22. 480 rem test for good date
  23. 500 if y2<80 or y2>1999 then 340
  24. 510 if y2<=99 then 540
  25. 520 if y2>99 and y2<1980 then 340
  26. 530 y2=y2-1900
  27. 540 m=m2:d=1:y=y2:gosub 1330
  28. 580 s1=k:gosub1450
  29. 610 rem print chart
  30. 630 e=s1-b1
  31. 640 open 4,4
  32. 670 print#4,"bio-rhythm analysis for ";n$
  33. 680 print#4," ":print#4," ";
  34. 710 gosub 1170 rem print mo.
  35. 800 print#4,y2:print#4," "
  36. 850 print#4,"    down        critical         up"
  37. 860 gosub 1170
  38. 880 print#4,"--------------------------------------"
  39. 890 d6=a(m2)
  40. 900 if m2=2 then gosub 1650
  41. 910 for i=1 to d6
  42. 920 print#4,i;
  43. 930 a$="                :                    "
  44. 940 j=33:gosub 1420
  45. 960 a$=left$(a$,y-1)+"i"+mid$(a$,y+1)
  46. 970 b$=a$:j=28:gosub1420
  47. 1000 b$=left$(b$,y-1)+"e"+mid$(b$,y+1)
  48. 1010 c$=b$:j=23:gosub 1420
  49. 1020 if i<=9 then print#4," ";
  50. 1040 c$=left$(c$,y-1)+"p"+mid$(c$,y+1):print#4,c$
  51. 1060 e=e+1:next i
  52. 1120 m4=m4-1:m2=m2+1
  53. 1130 if m4<=0 then 1780
  54. 1140 gosub 1570
  55. 1145 print#4," ":print#4," ":print#4," "
  56. 1147 gosub 1570
  57. 1150 goto 670
  58. 1170 rem print chart month
  59. 1190 if m2=1 then print#4,"jan.";
  60. 1200 if m2=2 then print#4,"feb.";
  61. 1210 if m2=3 then print#4,"mar.";
  62. 1220 if m2=4 then print#4,"apr.";
  63. 1230 if m2=5 then print#4,"may.";
  64. 1240 if m2=6 then print#4,"jun.";
  65. 1250 if m2=7 then print#4,"jul.";
  66. 1260 if m2=8 then print#4,"aug.";
  67. 1270 if m2=9 then print#4,"sep.";
  68. 1280 if m2=10 then print#4,"oct.";
  69. 1290 if m2=11 then print#4,"nov.";
  70. 1300 if m2=12 then print#4,"dec.";
  71. 1310 return
  72. 1330 rem compute julian date
  73. 1350 if m>2 then 1390
  74. 1360 m3=m+13:y=y-1:goto 1400
  75. 1390 m3=m+1
  76. 1400 k=int(365.25*y)+int(30.6001*m3)+d
  77. 1410 return
  78. 1420 y=int(12*sin(6.28318*e/j)+18.5)
  79. 1430 return
  80. 1450 rem read in days of the month
  81. 1470 : rem   dimmed already - ln. #5
  82. 1480 data 31,28,31,30,31,30,31,31,30,31,30,31
  83. 1490 d6=0
  84. 1500 for i=1 to 12
  85. 1510 read a:a(i)=a:next i
  86. 1530 print"for how many months do you":print"want your bio-rhythm ";
  87. 1540 input m4
  88. 1550 print:print
  89. 1570 if m2<13 then 1600
  90. 1580 m2=m2-12:y2=y2+1
  91. 1600 if m2=2 then gosub 1650
  92. 1605 print"[144]please turn your printer on-line"
  93. 1606 print"press a key to print.":poke198,0:wait198,1
  94. 1610 return
  95. 1630 rem is it leap year?
  96. 1650 le=y2-80
  97. 1660 if le>19 then 340
  98. 1670 if le/4-int(le/4)<.1 then 1730
  99. 1700 return
  100. 1730 d6=29
  101. 1740 return
  102. 1750 y2=y2+1:m2=m2-12
  103. 1770 return
  104. 1780 for i=1 to 8:print#4," ":next i
  105. 1790 print#4:close 4
  106. 1800 print"like to try another?"
  107. 1805 poke198,0:wait198,1:getk$:ifk$<>"y"andk$<>"n"then1805
  108. 1810 ifk$="y"thenrestore:print"[147]":goto110
  109. 1900 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
  110. 1910 poke631,13:poke632,13:poke198,2:end
  111.