home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1987 October
/
1987-10.d64
/
stars
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
7KB
|
201 lines
10 rem copyright 1987 compute! publications, inc. - all rights reserved
20 poke55,0:poke56,84:clr:rd=(NULL)/180
30 dimsx(150),sy(150),sm(200),mo(12),c$(35),cs(35),et(12),mt(12),b%(35)
40 print"[147][144]copyright 1987 compute! pub., inc."
50 printtab(11)"all rights reserved"
60 print""tab(16)" stars [146]":print"please wait 20 seconds..."
70 fori=1to12:readet(i),mt(i):next
80 fori=1to33:reada:poke49151+i,a:x=x+a:next
90 ifx<>5810thenprint"error in ml data statement.":stop
100 poke56334,peek(56334)and254:poke1,peek(1)and251
110 sys49152:poke1,peek(1)or4:poke56334,peek(56334)or1
120 fori=1to4:readpo(i),di(i):next:gosub550
130 fori=1to12:readmo(i):next
140 fori=0to3:a%(i)=peek(63+i):next:print"[147]":qz=0
150 poke198,0:print" menu [146]"
160 print"(press return for default responses)":print"0 - quit"
170 print"1 - simulation":print"2 - constellation study"
180 print"3 - constellation study with quiz":input" choice (1 - 3):[146] 2[157][157][157]";aa
190 ifaa<1oraa>3thenend
200 onaagoto210,250,250
210 aa=4:input"hourly or monthly simulation(h or m)[146] m[157][157][157]";a$
220 ifa$="h"thenhb=1:db=0:goto250
230 ifa$="m"thenhb=0:db=30:goto250
240 goto210
250 gosub1270:gosub590
260 is=0:lb$="computing":x=869:gosub840
270 readra:ifra>0then320
280 ifra=0then380
290 readlb$:ci=ra*-1:x=949:bh=0:ifla>.5andci=20then380
300 gosub1260:gosub840
310 sm(is)=6:sx(is)=ci:is=is+1:c$(ci)=lb$:goto360
320 readdc,mg:ifbh=1thenmg=5:goto350
330 gosub1500:ifal<0thenmg=5:bh=1:goto350
340 gosub930:ifaa>1thengosub750
350 sx(is)=x:sy(is)=y:sm(is)=mg:is=is+1
360 ifpeek(653)=4thengosub490:goto150
370 goto270
380 sm(is)=255:ifaa=4thenaa=1:goto410
390 onaagoto400,480,960
400 gosub590:gosub700
410 a2=a2+hb:ifa2>=24thena2=a2-24:dd=dd+1:jd=jd+1
420 dd=dd+db:jd=jd+db
430 ifdd>mo(mm)thendd=dd-mo(mm):mm=mm+1:ifmm>12thenmm=1
440 ifdd>mo(mm)then430
450 tm=int(a2)+an/60
460 fori=0to3:poke63+i,a%(i):next:la=la/rd
470 gosub1380:goto260
480 lb$="press return":x=868:gosub1260:gosub840:poke198,0:wait198,1
490 fori=0to3:poke63+i,a%(i):next:la=la/rd:gosub500:goto150
500 poke53272,20:poke56576,3:poke53265,peek(53265)and223:poke648,4:poke53280,15
510 return
520 xc=int(x0/8):yr=int(y0/8):ln=y0and7
530 pt=ad+yr*320+xc*8+ln:xb=7-(x0and7)
540 pokept,peek(pt)or2^xb:return
550 s8=32769:l8=8000:n6=32768:poke40769,0:gosub860:ad=n6
560 fori=1to180step2:x0=127*sin(2*i*rd)+127:y0=100*cos(2*i*rd)+100
570 gosub520:next
580 forj=1to4:x=po(j):y=di(j):gosub850:next:return
590 bg=0:iftm>mt(mm)andtm<et(mm)thenbg=6
600 poke53280,bg:ad=24576:s8=23553:l8=1000:n6=23552:poke24553,bg+16:gosub860
610 s8=32768:l8=8000:n6=ad:gosub860
620 poke53265,peek(53265)or32:poke53272,120:poke56576,2:ad=24576
630 x=27:lb$=str$(mm):gosub820
640 x=29:y=376:gosub850
650 x=31:lb$=str$(dd):gosub820
660 a4=int(a2):td$="am":ifa4>=12thentd$="pm":ifa4>12thena4=a4-12
670 x=67:lb$=str$(a4):gosub820:x=69:y=464:gosub850
680 a4=int(an):x=70:lb$=str$(a4):iflen(lb$)=2thenlb$=" 0"+right$(lb$,1)
690 gosub820:x=73:lb$=td$:gosub840:return
700 is=0
710 mg=sm(is):x=sx(is):y=sy(is):ifmg=255thenreturn
720 ifx=0then740
730 gosub750
740 is=is+1:goto710
750 onmggoto760,790,800,800,810,810
760 x0=x:y0=y+1:gosub520:x0=x+1:y0=y:gosub520:x0=x+2:y0=y:gosub520
770 x0=x+3:y0=y+1:gosub520
780 x0=x+1:y0=y+2:gosub520:x0=x+2:y0=y+2:gosub520
790 x0=x+1:y0=y+1:gosub520
800 x0=x+2:y0=y+1:gosub520
810 return
820 forj=1tolen(lb$)-1:y=(val(mid$(lb$,j+1,1))+48)*8:gosub850:x=x+1
830 next:return
840 forj=1tolen(lb$):y=(asc(mid$(lb$,j,1))-64)*8:gosub850:x=x+1:next:return
850 l8=7:s8=21504+abs(y):n6=ad+x*8:gosub860:return
860 l8=l8+1:e6=n6+l8:e8=s8+l8
870 a%=l8/256:a6=l8-256*a%
880 b%=(e6-a6)/256:b6=e6-256*b%-a6
890 c%=(e8-a6)/256:c6=e8-256*c%-a6
900 poke781,a%+1:poke782,a6:poke91,c%:poke90,c6:poke89,b%:poke88,b6
910 ifa6=0thensys41971:return
920 sys41964:return
930 az=2*(NULL)-az:q=sin((NULL)/4-al/2)/cos((NULL)/4-al/2)
940 x=int((100*q*sin(az)+100)*1.27)
950 y=99-int(100*q*cos(az)):return
960 is=1:i=0:gosub590:lb$="sorting":x=950:gosub840
970 bh=0
980 ifsm(i)=255thencs(is)=0:goto1050
990 cs(is)=sx(i)
1000 ifsm(i+1)>5theni=i+1:goto980
1010 i=i+1:ifsm(i)=5thenbh=1
1020 ifsm(i)<6then1010
1030 ifbh=0thenis=is+1
1040 goto970
1050 nc=is-1
1060 fori=1tonc:b%(i)=i:next
1070 forj=1to5:fork=1tonc:l=b%(int(rnd(1)*nc+1)):t9=b%(k):b%(k)=b%(l)
1080 b%(l)=t9:nextk,j
1090 forks=1tonc:is=0:bh=0:js=b%(ks)
1100 mg=sm(is):x=sx(is):y=sy(is):ifmg=255thengoto1150
1110 ifmg=6thencn=x:goto1140
1120 ifcn=cs(js)thenbh=1:gosub750
1130 ifcn<>cs(js)andbh=1then1150
1140 is=is+1:goto1100
1150 gosub1260:lb$="name":x=949:gosub840:y=464:gosub850:g$="":x=989
1160 poke198,0:wait198,1:getlb$:ifasc(lb$)=13then1190
1170 ifasc(lb$)=20thengosub1250:goto1160
1180 gosub840:g$=g$+lb$:goto1160
1190 ifg$=c$(cs(js))thenlb$="correct":x=910:gosub840:qz=qz+1:goto1210
1200 lb$=c$(cs(js)):x=909:gosub840:fori=1to500:nexti
1210 gosub1260
1220 nextks
1230 print"[147]you answered";qz;"[157] correct out of";nc;"[157] [146]"
1240 gosub500:print"please wait":gosub550:goto490
1250 lb$=" ":x=x-1:g$=left$(g$,len(g$)-1):gosub840:x=x-1:return
1260 forj=0to2:s8=31849+j*320:l8=96:n6=s8-1:pokes8+l8,0:gosub860:nextj:return
1270 print"[147]":ifaa=4thenprint"starting ";
1280 print"date and time of sky display"
1290 poke198,0:input"month (1-12):[146] 1[157][157][157]";mm:ifmm<1ormm>12then1290
1300 input" day:[146] 1[157][157][157]";dd:ifdd<1ordd>31then1300
1310 jd=2446429.5:da=dd:ifmm>1thenfori=1tomm-1:da=da+mo(i):next
1320 jd=jd+da
1330 a2=0:an=0:poke198,0:input"hour (0-12):[146] 9[157][157][157]";a2:b$=" "
1340 ifa2<12thenprint" am or pm [146] pm[157][157][157][157]";:inputb$
1350 ifb$="pm"thena2=a2+12
1360 tm=a2:an=(tm-int(tm))*60
1370 poke198,0:print" latitude:[146] 40[157][157][157][157]";:input la
1380 fd=tm/24+.5:iffd=>1thenfd=fd-1:jd=jd+1
1390 da=da+fd:d3=jd-2451545
1400 t3=d3/36525:t1=int(t3)
1410 t2=(jd-t1*36525-2451544.5)/36525
1420 s3=24110.54841+184.812866*t1+8640184.812866*t2+.093104*t3*t3
1430 s3=(s3-0.0000062*t3*t3*t3)/86400:s3=24*(s3-int(s3)+(fd-.5)*1.002737909)
1440 ifs3<0thens3=s3+24
1450 ifs3>24thens3=s3-24
1460 h3=int(s3):m3=int(60*(s3-h3))
1470 tg=h3+m3/60
1480 la=la*rd
1490 return
1500 dc=dc*rd:ra=ra*15*rd
1510 t5=tg*15*rd-ra
1520 s1=sin(la)*sin(dc)+cos(la)*cos(dc)*cos(t5)
1530 c1=1-s1*s1
1540 ifc1>0thenc1=sqr(c1)
1550 ifc1<=0thenal=sgn(s1)*(NULL)/2:goto1570
1560 al=atn(s1/c1)
1570 c2=cos(la)*sin(dc)-sin(la)*cos(dc)*cos(t5)
1580 s2=-cos(dc)*sin(t5)
1590 ifc2=0thenaz=sgn(s2)*(NULL)/2:goto1620
1600 az=atn(s2/c2)
1610 ifc2<0thenaz=az+(NULL)
1620 ifaz<0thenaz=az+2*(NULL)
1630 print"[147]":return
1640 data 19,6,19,6,20,5,21,4,21,3,22,3,21,3,20,4,20,4,19,5,18,5,18,6
1650 rem ml data is in next 2 lines
1660 data 169,0,133,251,133,253,169,208,133,252,169,84,133,254,162,16,160,0
1670 data 177,251,145,253,136,208,249,230,252,230,254,202,208,240,96
1680 data 16,112,480,40,976,152,511,184
1690 data31,28,31,30,31,30,31,31,30,31,30,31
1700 data -1,"polaris",2,89,2
1710 data -2,"big dipper"
1720 data 11,57,2,11,63,2,11.8,54,2,12.2,58,3,12.9,57,2,13.4,55,2,13.7,50,2
1730 data -3,"arcturus",14.3,19.5,1
1740 data -4,"virgo",13.4,-11,1,12.6,-1,3,12.9,3,3,13,11,3
1750 data -5,"pegasus",0.2,15,3,23,14,2,23,28,2,.1,29,2
1760 data -6,"auriga",5.2,46,1,5.9,45,2,5.9,37,2,4.9,33,3,5.4,29,2
1770 data -7,"orion",5.9,8,1,5.4,7,2,5.75,-2,2,5.6,-1,2,5.45,0,2
1780 data 5.6,-5.5,4,5.2,-8.5,1,5.8,-10,2
1790 data -8,"vega",18.6,39,1,-9,"cygnus"
1800 data 20.7,45,1,20.3,40,2,19.7,45,3,20.75,34,2,19.5,28,3,19.9,35,4
1810 data -10,"canis major",6.7,-17,1,6.4,-18,2
1820 data-11,"aquila",19.8,9,1,19.1,13.5,3,20.1,-1,3,19.4,3,3,19.1,-5,3
1830 data -12,"scorpius",16.5,-26,1,16,-20,2,15.9,-22,2,15.9,-26,3
1840 data 17.6,-43,2,16.7,-34,2,17.6,-37,2,16.7,-38,3,17.2,-43,3
1850 data -13,"cassiopeia",1.9,63.5,4,1.4,60,3,0.9,60.5,2,0.6,56,2,0.1,59,2
1860 data -14,"taurus",4.6,16,1,4.2,15,4,4.4,19,3
1870 data -15,"canis minor",7.6,6,1,7.4,9,3
1880 data -16,"gemini",7.5,32,1,7.7,28,1,6.7,25,3,6.6,16,2,6.3,22,3
1890 data -17,"leo"
1900 data10.1,12.5,1,10.1,17,3,10.3,20,2,10.3,24,3,9.8,26,4,9.7,24,3
1910 data 11.2,21,2,11.2,16,3,11.8,15,2
1920 data-18,"sagittarius",18.3,-30,3,18,-30.5,3,18.4,-25,3,18.9,-26,2,19,-30,2