home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 18 / 018.d81 / halley (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  4KB  |  179 lines

  1. 30 iffl=0thenpoke45,56:poke46,74:clr:fl=1
  2. 40 poke53280,0:poke53281,0:poke45,56:poke46,74:poke650,255
  3. 50 text=8198
  4. 100 ifun=0thenun=1:load"unpacker",8,1
  5. 110 :
  6. 120 poke249,224:poke250,204
  7. 140 poke251,0:poke252,64
  8. 160 poke253,0:poke254,0
  9. 180 ifx=0thenx=1:load"title.shp",8,1
  10. 200 ifx=1thenx=2:sys51456:sys51459
  11. 202 ifct>0then900
  12. 204 ifdh>0then800
  13. 205 ifpo>0then610
  14. 206 ifbl>0then540
  15. 260 h%=10
  16. 320 data sunday,monday,tuesday,wednesday,thursday,friday,saturday
  17. 340 dim wd%(120),mo%(120),da%(120),ti%(120)
  18. 360 dim nx%(120),ny%(120),sh%(120),m$(120)
  19. 380 gosub4240
  20. 400 dt%=1
  21. 420 i%=1
  22. 440 d=4:fori=1to120:wd%(i)=d:d=d+1:ifd>7thend = 1
  23. 460 next 
  24. 480 i%(1)=1:i%(2)=32:i%(3)=60:i%(4)=91
  25. 500 :
  26. 520 :
  27. 540 ifbl=0thenbl=1:a=49152:                 load"horizons.bdata",8,1
  28. 560 fori=1to117:n=peek(a):ifn=255thena=a+1:next:goto 600
  29. 580 nx%(i)=n:a=a+1:n=peek(a):ny%(i)=n:a=a+1:next
  30. 600 fori=1to120:n=peek(a):sh%(i)=n:a=a+1:next
  31. 610 ifpo=0thenpo=1:load"plotter.o",8,1
  32. 620 open2,8,2,"wordy.data"
  33. 640 fori=1to120:input#2,m$(i)
  34. 660 ifm$(i)="x"thenm$(i)=m$(i-1)
  35. 680 next:close2
  36. 700 fori=1to120
  37. 720 ifi<26thenti%(i)=1:next:goto 800
  38. 740 ifi>105thenti%(i)=1:next:goto 800
  39. 760 ifi>=100 and i<106 or i>25 and i<51 then ti%(i) = 255
  40. 780 next 
  41. 800 ifdh=0thendh=1:load"display.shp",8,1
  42. 820 poke249,224:poke250,204
  43. 840 poke251,0:poke252,64
  44. 860 poke253,0:poke254,0
  45. 880 sys51456
  46. 900 ifct=0thenct=1:load"comet.table",8,1
  47. 1000 rem              sys51462
  48. 1020 gosub 2200:hc%=8
  49. 1040 gosub 1440
  50. 1060 t$="date:"+str$(mo%(i%))+"/"+str$(da%(i%))+" "+dy$+"   "
  51. 1062 iflen(t$)<25thent$=t$+" ":goto1062
  52. 1065 systext,t$,16,182
  53. 1080 t$="time:"
  54. 1100 ifti%(i%)=0thent$=t$+"sunrise":goto1150
  55. 1120 ifti%(i%)=1thent$=t$+"sunset ":goto 1150
  56. 1140 t$=t$+"-------"
  57. 1150 sys text,t$,216,182
  58. 1160 k=peek(198):ifk>0then1240
  59. 1180 iffl%=0thenfl%=1:plot=8192:goto1220
  60. 1200 iffl%=1thenfl%=0:plot=8195
  61. 1220 gosub3820:goto1160
  62. 1240 geta$:poke198,0
  63. 1245 iffl%=0thenplot=8192:gosub 3820
  64. 1260 :
  65. 1280 ifa$="[133]"thengosub2280:goto1440
  66. 1300 ifa$="[136]"thengosub2400:goto1440
  67. 1320 ifa$="t"ora$="t"thengosub2480:goto1440
  68. 1340 :rem   no information
  69. 1360 ifa$="q"thengosub3340:goto1440
  70. 1380 ifa$="h"thengosub3480:goto1440
  71. 1400 ifhc%=0thenhc%=4:goto1160
  72. 1420 goto1160
  73. 1440 plot=8192:gosub3820
  74. 1442 gosub 3940
  75. 1480 gosub 3980: goto 1060
  76. 2160 return
  77. 2180 printspc(((42-len(a$))/2)):printa$;:return
  78. 2200 rem 
  79. 2220 dy=wd%(i%):restore
  80. 2240 fori=1tody:readdy$:next:return
  81. 2260 return 
  82. 2280 rem 
  83. 2300 plot=8195:gosub 3820
  84. 2320 ifi%-dt%<1theni%=1:goto2360
  85. 2340 ifi%>=1+dt%theni%=i%-dt%
  86. 2360 gosub2200
  87. 2380 return 
  88. 2400 rem 
  89. 2420 plot=8195:gosub 3820
  90. 2440 i%=i%+dt%:ifi%>120theni%=120
  91. 2460 gosub2200:return
  92. 2480 rem 
  93. 2500 sys51459:print"[147]"
  94. 2520 print "* time *
  95. 2540 [153] "  g)o to a specific date": [153] "  a)djust the time increment";
  96. 2560 [151]198,0:[146]198,1:[161]a$:[153]
  97. 2580 [139]a$[178]"g"[167] 2640
  98. 2600 [139]a$[178]"a"[167] 2940
  99. 2620 [158]51459:[142]
  100. 2640 [143] 
  101. 2660 [153]"loadacceptable dates between 1/1 and 4/30": [153]
  102. 2680 mo$[178]"":[133]"go to which month (1-4)  > ";mo$
  103. 2700 [139]mo$[178]""[167][158]51459:[142]
  104. 2720 da$[178]"":[133] "go to which day (1-31)   > ";da$
  105. 2740 [139]da$[178]""[167][158]51459:[142]
  106. 2760 [139][197](mo$)[179]1[176][197](mo$)[177]4[167]3040
  107. 2780 [139][197](da$)[179]1[176][197](da$)[177]31[167]3040
  108. 2800 [139]mo$[178]"2"[167][139][197](da$)[177]28[167]3040
  109. 2820 [139]mo$[178]"4"[167][139][197](da$)[177]30[167]3040
  110. 2840 plot[178]8195:[141] 3820
  111. 2860 m%[178][197](mo$):d%[178][197](da$)
  112. 2880 i%[178]i%(m%)[170]d%[171]1
  113. 2900 [141]2200
  114. 2920 [158]51459:[142]
  115. 2940 [143] 
  116. 2960 [153]"loadcurrent time increment ="dt%"days per move"
  117. 2980 a$[178]"":[133]"enter a new increment -> ";a$:[139]a$[178]""[167][158]51459:[142]
  118. 3000 dt%[178][197](a$):[139]dt%[179][178]0[167]dt%[178]1
  119. 3020 [158]51459:[142]
  120. 3040 [143] 
  121. 3060 [153]"loadbad date...": [129] i [178] 1 [164] 2000: [130]
  122. 3080 [158]51459:[142]
  123. 3340 [143] 
  124. 3360 [158]51459:[153]"loadquit for sure? ";:[151]198,0:[146]198,1:[161]a$:[153]a$
  125. 3380 [139]a$[179][177]"y"[175]a$[179][177]"y"[167][158]51459:[142]
  126. 3400 [153]"load"
  127. 3420 [153] "bye!"
  128. 3440 [147]"hello connect",8
  129. 3460 [128]
  130. 3480 [143] 
  131. 3500 [158]51459:[153]"load"
  132. 3520 [153]"             * help! *wait"
  133. 3540 [153]""
  134. 3560 [153]"this program displays the locations"
  135. 3580 [153]"of halley's comet as it will appear on"
  136. 3600 [153]"the southern horizon during the first"
  137. 3620 [153]"120 days of 1986, jan 1 - apr 30.":[153]:[153]
  138. 3640 [153]"        use f1 or f7 to step"
  139. 3660 [153]"  backward and forward through time":[153]""
  140. 3680 [153]"press <t> to either <g>o to a specific"
  141. 3700 [153]"date or to <a>djust the time increment"
  142. 3720 [153]
  143. 3760 [153]"    press 'q' to exit the program"
  144. 3765 [153]"      press any key to continue."
  145. 3780 k[178][194](198):[139]k[178]0[167]3780
  146. 3800 [158]51459:[142]
  147. 3820 [143] 
  148. 3840 [139]nx%(i%)[178]0[167][142]
  149. 3860 xd[178]93[170]nx%(i%):yd[178]144[171]ny%(i%)[172]2:         [158]plot,xd,yd
  150. 3880 [158]plot,xd[171]1,yd[171]1:[158]plot,xd,yd[171]1:[158]plot,xd[170]1,yd[171]1:[158]plot,xd[171]1,yd
  151. 3900 [158]plot,xd[170]1,yd:[158]plot,xd[171]1,yd[170]1:[158]plot,xd,yd[170]1:[158]plot,xd[170]1,yd[170]1
  152. 3920 [142]
  153. 3940 [151]249,224:[151]250,204
  154. 3942 [151]251,0:[151]252,64
  155. 3944 [151]253,3:[151]254,1
  156. 3950 [151]255,sh%(i%):[158]51462
  157. 3960 [142] 
  158. 3980 [143] 
  159. 4000 [151]53280,0
  160. 4010 :
  161. 4020 yp[178]190:t$[178]"                                        ":[158]text,t$,0,yp
  162. 4040 xp[178]((41[171][195](m$(i%)))[173]2)[172]8:t$[178]m$(i%)
  163. 4050 [158]text,t$,xp,yp
  164. 4060 [142] 
  165. 4080 [142]
  166. 4220 :
  167. 4240 [143] 
  168. 4260 m%[178]1:d%[178]1
  169. 4280 [129]i[178]1[164]120
  170. 4300 mo%(i)[178]m%:da%(i)[178]d%
  171. 4320 d%[178]d%[170]1
  172. 4340 [139]m%[178]1[167][139]d%[177]31[167]4440
  173. 4360 [139]m%[178]2[167][139]d%[177]28[167]4440
  174. 4380 [139]m%[178]3[167][139]d%[177]31[167]4440
  175. 4400 [139]m%[178]4[167][139]d%[177]30[167]4440
  176. 4420 [130]:[142]
  177. 4440 m%[178]m%[170]1:d%[178]1
  178. 4460 [130]:[142]
  179.