home *** CD-ROM | disk | FTP | other *** search
- 30 poke53280,0:poke53281,0:gosub60000:poke 198,0
- 40 clr:poke 788,52
- 42 dim cr(1,2),cr$(1,2),cu$(4),fr(1,1,2),fr$(1,1,2),k(1),ms$(20),rt(2)
- 50 dim a,a0,a1,a2,ad,a$,b,b0,b1,b2,b$
- 60 dim c,c0,c1,c2,cp,cs,cu,cv,c0$,c1$,c2$,c3$,c4$,c5$,cu$
- 70 dim d,db,dp,ds,dv,em,ex,fe,fq,ft,h,h0,h1,h2,h$
- 80 dim j,k,kc$,l,m,mc,mc$,ms,n,ns,pr,pw,r0,r1,r2,rs
- 90 dim s,so,sc$,sr$,t0,t1,ta,tb,tc,uc,v0,v1,v2,wd$,x,xp,xs,y,yp,ys
- 110 dv=peek(186):if dv<8 then dv=8
- 130 sys57812"trigfont",dv,0:poke780,0:poke781,0:poke782,232:sys65493
- 140 sys57812"trig.obj",dv,0:poke780,0:poke781,0:poke782,192:sys65493
- 150 ad=49152:sysad+15,0:sysad+21,1:poke53265,peek(53265)and191
- 152 print"[147]"chr$(142)
- 153 poke53280,6:poke53281,14:poke53282,0:poke53283,1:poke53284,6
- 160 gosub 4720:sr$=chr$(20)+"1234567890.[145][157][133][147][134]q[209]h[200]p[208]"+chr$(13)
- 170 cu$(1)="( [196][196] )":cu$(2)="([196][205][211] )":cu$(3)="([210][193][196] )":cu$(4)="([199][210][193][196])"
- 180 wd$="":x=0:y=0:sc$=" [157][157][157][157][157][157][157][157][157][157][157][157][157][157]":cu=1
- 190 kc$=" [157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]":poke53269,0:poke650,128:db=0
- 200 c0$="[158]":c1$="[129]":c2$="[156]":c3$="":c4$=""
- 210 forj=0to1:fork=0to2:poke214,2*k+13:poke211,18*j+5:sys58732:printc0$sc$
- 220 next:next:gosub 1980:poke214,13:poke211,5:sys58732:sysad+9,0
- 240 rem *** main input loop ***
- 250 printchr$(142);: gosub 3930:ms=10:gosub 3880
- 260 ft=1
- 270 on ft gosub 550,530
- 280 for j=1 to 50
- 290 get a$:if a$="" then next:ft=1-(ft=1):goto 270
- 300 j=50:next
- 310 for j=1tolen(sr$):ifmid$(sr$,j,1)=a$then uc=j:j=len(sr$):next:goto 330
- 320 next:mc=1:ms=13:gosub3880:goto260
- 330 gosub 530:ifmcthenms=0:gosub3880:mc=0
- 340 on uc goto 420,370,370,370,370,370,370,370,370,370,370,380
- 350 on uc-12 goto 390,390,390,390,400,400,400,400,400,400,410,410,440,440,430
- 360 goto 270
- 370 gosub 860:goto 260:rem numbers
- 380 gosub 890:goto 260:rem dec point
- 390 gosub 960:goto 260:rem cursors
- 400 gosub 1890:goto 260:rem fkeys
- 410 gosub 4270:goto 260:rem help
- 420 gosub 920:goto 260:rem delete
- 430 gosub 1050:goto 260:rem return
- 440 gosub 1390:goto 260:rem printer
- 450 rem *** end program ***
- 460 poke 788,49:sysad+18,12,1,8
- 470 goto40000
- 520 sysad+18,12,1,8:print"[147]";:end
- 530 a=40*peek(214)+peek(211)+256*peek(648)
- 540 poke a,peek(a)and127:return
- 550 a=40*peek(214)+peek(211)+256*peek(648)
- 560 poke a,peek(a)or128:return
- 570 if len(wd$) then return
- 580 printc0$sc$;:return
- 590 rem *** fe sound ***
- 600 s=54272:sysad+24
- 610 pokes+1,08:pokes+4,32:pokes+6,240:pokes+24,15:poke s+4,33
- 620 for j=1 to 1000:next:pokes+4,16
- 630 sysad+24:return
- 640 s=54272:sysad+24
- 650 pokes+1,fq:pokes+3,pw:pokes+4,64:pokes+5,11:pokes+24,15:pokes+4,65:return
- 660 rem *** title screen ***
- 670 gosub60000:poke53280,6:poke53281,14:poke53282,0:poke53283,1:poke53284,6
- 680 poke 53265,peek(53265)or 64
- 690 tb=7
- 850 return
- 860 rem *** numerals ***
- 870 if (len(wd$)-dp)>=9 then return
- 880 gosub 570:printa$;:wd$=wd$+a$:return
- 890 rem *** decimal point ***
- 900 if dp then return
- 910 gosub 570:dp=1:printa$;:wd$=wd$+a$:return
- 920 rem *** delete ***
- 930 if len(wd$)=0 then return
- 940 if right$(wd$,1)="." then dp=0
- 950 wd$=left$(wd$,len(wd$)-1):print" [157][157] [157]";:return
- 960 rem *** cursors ***
- 970 poke214,2*y+13:poke211,18*x+5:sys58732:printc0$sc$cr$(x,y);
- 980 if a$="" and y<2 then y=y+1:goto 1020
- 990 if a$="[145]" and y>0 then y=y-1:goto 1020
- 1000 if a$="" and x=0 then x=1:goto 1020
- 1010 if a$="[157]" and x=1 then x=0
- 1020 poke 214,2*y+13:poke 211,18*x+5:sys 58732:
- 1030 wd$="":dp=0:return
- 1040 rem *** return ***
- 1050 gosub 530:if wd$="" then return
- 1060 if val(wd$)=0 then cr$(x,y)="":goto 1130
- 1070 if val(cr$(x,y)) then 1120
- 1080 a=sgn(val(cr$(1,0)))+sgn(val(cr$(1,1)))+sgn(val(cr$(1,2)))
- 1090 if x=1 and a>=2 then 1130
- 1100 b=sgn(val(cr$(0,0)))+sgn(val(cr$(0,1)))+sgn(val(cr$(0,2)))
- 1110 if a+b>=3 then 1130
- 1120 cr$(x,y)=wd$
- 1130 poke 214,2*y+13:poke211,18*x+5:sys58732:wd$="":dp=0
- 1140 printsc$cr$(x,y):poke 214,2*y+13:poke211,18*x+5:sys58732:return
- 1150 rem *** f(a0,b0,c0)=a1 ***
- 1160 if b0*c0=0 then em=15:goto 3290
- 1170 a1=b0*b0+c0*c0-a0*a0
- 1180 a1=a1/(2*b0*c0)
- 1190 if a1=0 then a1=(NULL)/2:return
- 1200 if a1>=1 then a1=0:return
- 1210 if a1<=-1 then a1=(NULL):return
- 1220 a1=atn(sqr(1-a1*a1)/a1)
- 1230 if a1<0 then a1=(NULL)+a1
- 1240 return
- 1250 rem *** f(a1,b0,c0)=a0 ***
- 1260 a0=b0*b0+c0*c0-2*b0*c0*cos(a1)
- 1270 if a0<0 then em=16:goto 3290
- 1280 a0=sqr(a0):return
- 1290 rem *** f(a1,b1,b0)=a0
- 1300 if sin(b1)=0 then em=15:goto 3290
- 1310 a0=b0*sin(a1)/sin(b1)
- 1320 return
- 1330 rem *** f(b0,b1,a0)=a1
- 1340 if b0=0 then em=15:goto 3290
- 1350 a1=a0*sin(b1)/b0
- 1360 if a1>=1 then a1=(NULL)/2:return
- 1370 if a1<0 then a1=0:return
- 1380 a1=atn(a1/sqr(1-a1*a1)):return
- 1390 rem *** print ***
- 1400 if so=0 then return
- 1410 ms=14:gosub 3880:mc=1
- 1420 sysad+9,3:xp=peek(211):yp=peek(214):cp=peek(646)
- 1430 poke214,11:poke211,0:sys58732:tb=11
- 1440 printtab(tb)"[158] [146]"
- 1450 printtab(tb)" [195][200][207][207][211][197] [196][197][214][201][195][197] "
- 1460 printtab(tb)" [146]"
- 1470 printtab(tb)" [146][159] [208]rinter#4 [158] "
- 1480 printtab(tb)" [146][159] [208]rinter#5 [158] "
- 1490 printtab(tb)" [146][159] [208]rinter#6 [158] "
- 1500 printtab(tb)" [146][159] [208]rinter#7 [158] "
- 1510 printtab(tb)" [146]"
- 1520 printtab(tb)" [195][210][211][210]/[210][197][212][213][210][206]/[211][212][207][208] "
- 1530 printtab(tb)" [146]"
- 1540 poke 198,0:sysad+27,12,14,16,4:pr=peek(780)
- 1550 pr=pr+3:if pr=3 then 1880
- 1560 sysad+3:sysad+30,0,39,0,7,160,12,0:poke53272,(peek(53272)and240)or10
- 1570 sysad+18,0,1,0:sysad+30,1,38,11,23,32,6,0:poke214,12:poke211,0:sys58732
- 1580 ms=14:gosub 3880
- 1590 printc3$"[211]et-up printer#"pr"and press any key,"
- 1600 print"or [209][146] to quit.":poke 198,0
- 1610 get a$:if a$="" then 1610
- 1620 if a$="q" or a$="[209]" then 1880
- 1630 open 15,pr,15:close 15:if st=0 then 1660
- 1640 printc1$"[208]rinter not detected!":sysad+33,32768
- 1650 ms=17:gosub 3880:forj=1to2000:next:goto1570
- 1660 print"[208]rinting...":ta=18:tb=40:sysad+36
- 1670 open pr,pr,7:cmd pr
- 1680 print" [211][201][196][197][211] [193][206][199][204][197][211] "cu$(cv);:sysad+42,40
- 1690 if so=2 then print" [211][201][196][197][211] [193][206][199][204][197][211] "cu$(cv);
- 1700 a=0:b=0:print:print"a= "fr$(a,0,b);:sysad+42,ta:print"[193]= ";:gosub 5060:a=1
- 1710 sysad+42,tb
- 1720 if so=2 then print"a= "fr$(a,0,b);:sysad+42,ta+tb:print"[193]= ";:gosub 5060
- 1730 a=0:b=1:print:print"b= "fr$(a,0,b);:sysad+42,ta:print"[194]= ";:gosub 5060:a=1
- 1740 sysad+42,tb
- 1750 if so=2 then print"b= "fr$(a,0,b);:sysad+42,ta+tb:print"[194]= ";:gosub 5060
- 1760 a=0:b=2:print:print"c= "fr$(a,0,b);:sysad+42,ta:print"[195]= ";:gosub 5060:a=1
- 1770 sysad+42,tb
- 1780 if so=2 then print"c= "fr$(a,0,b);:sysad+42,ta+tb:print"[195]= ";:gosub 5060
- 1790 a=0:print:print" [193]rea=";:gosub 5130:sysad+42,tb:a=1
- 1800 if so=2 then print" [193]rea=";:gosub 5130
- 1810 a=0:b=0:print:print"ha=";:gosub5150:sysad+42,tb:a=1
- 1820 if so=2 then print"ha=";:gosub 5150
- 1830 a=0:b=1:print:print"hb=";:gosub5150:sysad+42,tb:a=1
- 1840 if so=2 then print"hb=";:gosub 5150
- 1850 a=0:b=2:print:print"hc=";:gosub5150:sysad+42,tb:a=1
- 1860 if so=2 then print"hc=";:gosub 5150
- 1870 print#pr:close pr
- 1880 sysad+39:sysad:sysad+12,3:poke214,yp:poke211,xp:sys58732:poke646,cp:return
- 1890 rem *** function keys ***
- 1900 on uc-16 goto 1920,1930,1960,2010,2010,2010
- 1910 return
- 1920 gosub 2100:return
- 1930 for n=0to2:for m=0to1
- 1940 cr$(m,n)="":next:next:sysad+12,0:wd$="":dp=0
- 1950 poke214,13:poke211,5:sys58732:x=0:y=0:ms=0:gosub 1980:goto 3880
- 1960 rem *** circular units ***
- 1970 cu=cu+1:if cu=5 then cu=1
- 1980 j=peek(214):k=peek(211)
- 1990 poke214,11:poke 211,30:sys58732:printc2$cu$(cu)c0$
- 2000 poke214,j:poke211,k:sys58732:return
- 2010 rem *** end program ***
- 2020 ms=5:t0=150:t1=50:gosub3970
- 2030 if a$<>"y" and a$<>"[217]" then 2090
- 2040 sysad+3:poke56578,peek(56578)or3
- 2050 poke 56576,(peek(56576)and252)or3
- 2060 poke53272,(peek(53272)and15)or16
- 2070 poke53272,(peek(53272)and240)or4
- 2080 poke 648,4:sysad+21,0:goto 450
- 2090 ms=0:goto 3880
- 2100 rem *** solve the triangle ***
- 2110 poke 198,0:ds=0:rs=0
- 2120 ms=11:gosub 3880:wd$="":dp=0
- 2130 for n=0 to 1:for m=0 to 2
- 2140 cr(n,m)=val(cr$(n,m)):next:next
- 2150 gosub 3040:ifcr(1,0)+cr(1,1)+cr(1,2)>=(NULL) then 3270
- 2160 if cr(0,0)*cr(0,1)*cr(0,2)=0 then 2200
- 2170 if cr(0,0)>=cr(0,1)+cr(0,2) then 3270
- 2180 if cr(0,1)>=cr(0,0)+cr(0,2) then 3270
- 2190 if cr(0,2)>=cr(0,0)+cr(0,1) then 3270
- 2200 ns=0:fe=0:rt(0)=0:rt(1)=1:rt(2)=2
- 2210 gosub 2280:if ns then return
- 2220 rt(0)=1:rt(1)=2:rt(2)=0
- 2230 gosub 2280:if ns then return
- 2240 rt(0)=2:rt(1)=0:rt(2)=1
- 2250 gosub 2280:if ns then return
- 2260 ifcr(0,0)=0 and cr(0,1)=0 and cr(0,2)=0 then ms=12:mc=1:goto 3880
- 2270 ms=3:mc=1:gosub 3880:fq=255:pw=10:goto 640
- 2280 rem *** sss ***
- 2290 if rt(0) then 2370
- 2300 if cr(0,rt(0))*cr(0,rt(1))*cr(0,rt(2))=0 then 2370
- 2310 a0=cr(0,rt(0)):b0=cr(0,rt(1)):c0=cr(0,rt(2)):gosub1150:cr(1,rt(0))=a1
- 2320 if fe then return
- 2330 a0=cr(0,rt(1)):b0=cr(0,rt(2)):c0=cr(0,rt(0)):gosub1150:cr(1,rt(1))=a1
- 2340 if fe then return
- 2350 cr(1,rt(2))=(NULL)-cr(1,rt(0))-cr(1,rt(1))
- 2360 gosub 3330:return
- 2370 rem *** sas ***
- 2380 if cr(0,rt(0))*cr(1,rt(1))*cr(0,rt(2))=0 then 2450
- 2390 b0=cr(0,rt(0)):c0=cr(0,rt(2)):a1=cr(1,rt(1)):gosub 1250:cr(0,rt(1))=a0
- 2400 if fe then return
- 2410 a0=cr(0,rt(0)):b0=cr(0,rt(1)):c0=cr(0,rt(2)):gosub 1150:cr(1,rt(0))=a1
- 2420 if fe then return
- 2430 cr(1,rt(2))=(NULL)-cr(1,rt(0))-cr(1,rt(1))
- 2440 gosub 3330:return
- 2450 rem *** asa ***
- 2460 if cr(1,rt(0))*cr(0,rt(1))*cr(1,rt(2))=0 then 2530
- 2470 cr(1,rt(1))=(NULL)-cr(1,rt(0))-cr(1,rt(2))
- 2480 a1=cr(1,rt(0)):b1=cr(1,rt(1)):b0=cr(0,rt(1)):gosub 1290:cr(0,rt(0))=a0
- 2490 if fe then return
- 2500 a1=cr(1,rt(2)):b1=cr(1,rt(1)):b0=cr(0,rt(1)):gosub 1290:cr(0,rt(2))=a0
- 2510 if fe then return
- 2520 gosub 3330:return
- 2530 rem *** aas,saa ***
- 2540 r0=0:r1=1:r2=2:gosub 2570:if ns then return
- 2550 r0=2:r1=1:r2=0:gosub 2570:if ns then return
- 2560 goto 2640
- 2570 if cr(1,rt(r0))*cr(1,rt(r1))*cr(0,rt(r0))=0 then return
- 2580 cr(1,rt(r2))=(NULL)-cr(1,rt(r0))-cr(1,rt(r1))
- 2590 a1=cr(1,rt(r1)):b1=cr(1,rt(r0)):b0=cr(0,rt(r0)):gosub1290:cr(0,rt(r1))=a0
- 2600 if fe then return
- 2610 a1=cr(1,rt(r2)):b1=cr(1,rt(r0)):b0=cr(0,rt(r0)):gosub1290:cr(0,rt(r2))=a0
- 2620 if fe then return
- 2630 gosub 3330:return
- 2640 rem *** ssa,ass ***
- 2650 r0=0:r1=1:r2=2:gosub 2680:if ns then return
- 2660 r0=2:r1=1:r2=0:gosub 2680:return
- 2670 rem
- 2680 if cr(0,rt(r0))*cr(0,rt(r1))*cr(1,rt(r0))=0 then return
- 2690 if cr(0,rt(r0))>cr(0,rt(r1)) then 2770:rem 1 solution
- 2700 if (cr(0,rt(r0))=cr(0,rt(r1)))and(cr(1,rt(r0)))>=(NULL)/2thenreturn:rem no sol.
- 2710 if cr(0,rt(r0))=cr(0,rt(r1))andcr(1,rt(r0))<(NULL)/2 then 2770:rem 1 sol.
- 2720 if abs(cr(0,rt(r0))-cr(0,rt(r1))*sin(cr(1,rt(r0))))>5e-8 then 2740
- 2730 cr(1,rt(r1))=(NULL)/2:goto 2800
- 2740 ifcr(0,rt(r0))>cr(0,rt(r1))*sin(cr(1,rt(r0))) then 2840:rem 2 solution
- 2750 if cr(0,rt(r0))<cr(0,rt(r1))*sin(cr(1,rt(r0))) then return
- 2760 return
- 2770 rem *** one solution ***
- 2780 b1=cr(1,rt(r0)):b0=cr(0,rt(r0)):a0=cr(0,rt(r1)):gosub1330:cr(1,rt(r1))=a1
- 2790 if fe then return
- 2800 cr(1,rt(r2))=(NULL)-cr(1,rt(r0))-cr(1,rt(r1))
- 2810 a1=cr(1,rt(r2)):b1=cr(1,rt(r0)):b0=cr(0,rt(r0)):gosub1290:cr(0,rt(r2))=a0
- 2820 if fe then return
- 2830 gosub 3330:return
- 2840 rem *** two solutions ***
- 2850 b1=cr(1,rt(r0)):b0=cr(0,rt(r0)):a0=cr(0,rt(r1)):gosub1330:cr(1,rt(r1))=a1
- 2860 if fe then return
- 2870 cr(1,rt(r2))=(NULL)-cr(1,rt(r0))-cr(1,rt(r1))
- 2880 a1=cr(1,rt(r2)):b1=cr(1,rt(r0)):b0=cr(0,rt(r0)):gosub1290:cr(0,rt(r2))=a0
- 2890 if fe then return
- 2900 ds=1:rs=0:gosub 3330:if fe then return
- 2910 cr(1,rt(r1))=(NULL)-cr(1,rt(r1))
- 2920 cr(1,rt(r2))=(NULL)-cr(1,rt(r0))-cr(1,rt(r1))
- 2930 a1=cr(1,rt(r2)):b1=cr(1,rt(r0)):b0=cr(0,rt(r0)):gosub1290:cr(0,rt(r2))=a0
- 2940 if fe then return
- 2950 rs=1:gosub 3330:if fe then return
- 2960 ms=7:gosub 3880:poke 198,0
- 2970 get a$:if a$="" then 2970
- 2980 ms=1:gosub 3880:rs=0:gosub 3520:poke 198,0
- 2990 get a$:if a$="" then 2990
- 3000 ms=2:gosub 3880:rs=1:gosub 3520:poke 198,0
- 3010 get a$:if a$="" then 3010
- 3020 if a$=" " then 2980
- 3030 fs=0:ds=0:ns=1:poke214,2*y+13:poke211,18*x+5:sys58732:mc=1:ms=0:goto 3880
- 3040 rem *** convert to radians ***
- 3050 if cu=3 then return
- 3060 if cu=1 then goto 3230
- 3070 if cu=2 then gosub 3120:goto 3230
- 3080 rem *** grads ==> rad ***
- 3090 for n=0 to 2
- 3100 cr(1,n)=(NULL)*cr(1,n)/200
- 3110 next:return
- 3120 rem *** dms ==> dd ***
- 3130 for n=0 to 2:s=0
- 3140 for j=1 to len(cr$(1,n))
- 3150 if mid$(cr$(1,n),j,1)="." then s=j:j=len(cr$(1,n)):next:goto 3170
- 3160 next:cr(1,n)=val(cr$(1,n)):next:return
- 3170 a=val(mid$(cr$(1,n),1,s))
- 3180 b=val(mid$(cr$(1,n),s+1,2))*(10+9*(len(mid$(cr$(1,n),s+1,2))<>1))
- 3190 c=val(mid$(cr$(1,n),s+3,2))*(10+9*(len(mid$(cr$(1,n),s+3,2))<>1))
- 3200 d=val(mid$(cr$(1,n),s+5,2))*(10+9*(len(mid$(cr$(1,n),s+5,2))<>1))
- 3210 cr(1,n)=a+b/60+c/3600+d/360000
- 3220 next:return
- 3230 rem *** dd ==> rad ***
- 3240 for n=0 to 2
- 3250 cr(1,n)=(NULL)*cr(1,n)/180
- 3260 next:return
- 3270 rem *** error ***
- 3280 fq=2:pw=8:gosub 640:t0=150:t1=50:ms=6:mc=1:goto 3970
- 3290 rem *** fatal error ***
- 3300 t0=150:t1=50:fe=1:ns=1:ms=9:mc=1:gosub 3880
- 3310 gosub 590:gosub 3970:ms=em:gosub 3880
- 3320 return
- 3330 rem *** display answers ***
- 3340 gosub 3710:if fe then return
- 3350 if ds=0 then so=1
- 3355 cv=cu:if ds and rs then so=2
- 3360 ns=1:for n=0 to 2
- 3370 m=0:fr(rs,m,n)=cr(m,n):gosub 3640
- 3380 m=1:if cu=1 or cu=2 then fr(rs,m,n)=180*cr(m,n)/(NULL)
- 3390 if cu=1 then gosub 3640:goto 3510
- 3400 if cu<>2 then 3490
- 3410 fr(rs,m,n)=fr(rs,m,n)+.000001
- 3420 a=int(fr(rs,m,n)):b=60*(fr(rs,m,n)-a)
- 3430 a$=str$(a):a$=right$(a$,len(a$)-1)
- 3440 a=int(b):b=60*(b-a)
- 3450 b$=str$(a):b$=right$(b$,len(b$)-1)
- 3460 b=int(100*b)/100
- 3470 c$=str$(b):c$=right$(c$,len(c$)-1)
- 3480 fr$(rs,m,n)=a$+"[171]"+b$+"[179]"+c$+"[177]":goto 3510
- 3490 if cu=3 then fr(rs,m,n)=cr(m,n):gosub 3640:goto 3510
- 3500 fr(rs,m,n)=200*cr(m,n)/(NULL):gosub 3640
- 3510 next:if ds then return
- 3520 for m=0 to 1:for n=0 to 2
- 3530 poke214,2*n+13:poke211,18*m+5:sys58732
- 3540 printc0$sc$fr$(rs,m,n):next:next
- 3550 k=(fr(rs,0,0)+fr(rs,0,1)+fr(rs,0,2))/2
- 3560 k=sqr(k*(k-fr(rs,0,0))*(k-fr(rs,0,1))*(k-fr(rs,0,2)))
- 3570 poke214,19:poke211,15:sys58732:printkc$k
- 3580 for n=0 to 2
- 3590 if fr(rs,0,n)=0 then h$="---":goto 3610
- 3600 h$=str$(2*k/fr(rs,0,n))
- 3610 poke214,21+n:poke211,5:sys58732:printc0$kc$h$:next
- 3620 if ds then return
- 3630 poke214,2*y+13:poke211,18*x+5:sys58732:mc=1:ms=8:goto 3880
- 3640 rem *** format output ***
- 3650 a$=str$(fr(rs,m,n))
- 3660 a$=right$(a$,len(a$)-1)
- 3670 fr$(rs,m,n)=a$:return
- 3680 rem ***
- 3690 rem ***
- 3700 rem ***
- 3710 rem *** check solution ***
- 3720 for l=0 to 1:gosub 3760:if fe then l=1:next:goto 3290
- 3730 next
- 3740 for l=0 to 1:gosub 3800:if fe then l=1:next:goto 3290
- 3750 next
- 3760 rem *** sub-check one ***
- 3770 for j=0 to 1:for k=0 to 2
- 3780 if cr(j,k)=0 then j=1:k=2:next:next:fe=1:em=6:return
- 3790 next:next:return
- 3800 rem *** sub-check two ***
- 3810 if cr(0,0)+cr(0,1)<=cr(0,2) then fe=1:em=6:return
- 3820 if cr(0,0)+cr(0,2)<=cr(0,1) then fe=1:em=6:return
- 3830 if cr(0,1)+cr(0,2)<=cr(0,0) then fe=1:em=6:return
- 3840 k=(cr(0,0)+cr(0,1)+cr(0,2))/2
- 3850 k=k*(k-cr(0,0))*(k-cr(0,1))*(k-cr(0,2))
- 3860 if k<0 then fe=1:em=16
- 3870 return
- 3880 rem *** print messages ***
- 3890 cs=peek(646):xs=peek(211):ys=peek(214)
- 3900 poke214,9:poke211,1:sys58732:printc1$mc$
- 3910 poke214,9:poke211,20-len(ms$(ms))/2:sys58732:printms$(ms)
- 3920 poke646,cs:poke214,ys:poke211,xs:sys58732:return
- 3930 rem *** read messages ***
- 3940 mc$=" "
- 3950 for n=0 to 20:readms$(n):next
- 3960 return
- 3970 rem *** flash message ***
- 3980 poke 198,0:j=peek(214):k=peek(211):l=peek(646):gosub 3880
- 3990 for n=1 to t0
- 4000 get a$:if a$="" then next:goto4020
- 4010 n=t0:next:poke214,j:poke211,k:sys58732:return
- 4020 sysad+30,1,38,9,9,32,1,1:for n=1 to t1
- 4030 get a$:if a$="" then next:sysad+30,1,38,9,9,32,9,1:goto3990
- 4040 n=t1:next:poke214,j:poke211,k:sys58732:sysad+30,1,38,9,8,32,9,1:return
- 4050 rem *** message data ***
- 4060 data "[211]tatus [207][203]":rem 0
- 4070 data "[211]olution one":rem 1
- 4080 data "[211]olution two":rem 2
- 4090 data "[206]o solution":rem 3
- 4100 data "[195]ontradictory data":rem 4
- 4110 data "[209]uit!? [193]re you sure? (y/n)":rem 5
- 4120 data "[201]mpossible triangle":rem 6
- 4130 data "[212]his triangle has two solutions...":rem 7
- 4140 data "[212]he complete solution is displayed":rem 8
- 4150 data "[198]atal error":rem 9
- 4160 data "[212][210][201][199][207][206]: [212]he trigonometry utility":rem 10
- 4170 data "[215]orking...":rem 11
- 4180 data "[206]eed at least one side":rem 12
- 4190 data "[208]ress '[200]' for help":rem 13
- 4200 data "[208]rint-out solution":rem 14
- 4210 data "[196]ivision by zero":rem 15
- 4220 data "[201]llegal quantity":rem 16
- 4230 data "[196]evice not present":rem 17
- 4240 data "end"
- 4250 data "end"
- 4260 data "end"
- 4270 rem *** help ***
- 4280 cs=peek(646):xs=peek(211):ys=peek(214):sysad+9,3
- 4290 sysad+15,0:sysad+3:sysad+18,1,1,7:poke53272,(peek(53272)and240)or10
- 4300 print"[154][147][212][210][201][199][207][206]"
- 4310 print" [212][210][201][199][207][206] is a utility that will "
- 4320 print" quickly solve the unknown parts of "
- 4330 print" triangles for you. [202]ust enter all the"
- 4340 print" known parts, and then press [198]1[154]. [201]n "
- 4350 print" seconds, the unknowns are calculated "
- 4360 print" and displayed."
- 4370 print" [198]3[154] cycles through the circular"
- 4380 print" units that [212][210][201][199][207][206] uses to solve the
- 4390 [153]" triangles. (NULL)hese units are:"
- 4400 [153]" openstr$str$cont = str$ecimal str$egrees"
- 4410 [153]" openstr$(NULL)(NULL)cont = str$egrees, (NULL)inutes, (NULL)econds"
- 4420 [153]" open(NULL)atnstr$cont = (NULL)adians"
- 4430 [153]" openchr$(NULL)atnstr$cont = chr$radians"
- 4440 [153]" peeke sure you have set the circular"
- 4450 [153]" units to the desired value peekvalasc(NULL)(NULL)val you"
- 4460 [153]" enter your angles. (NULL)(NULL)(NULL)val: (NULL)hen in str$(NULL)(NULL)"
- 4470 [153]" 23-7<2.92> must be entered as:"
- 4480 [153]"23.070292"
- 4490 [153]"def >>> (NULL)ress any key <<< waitcont";:[151] 198,0:[158]ad[170]15,1
- 4500 [161] a$:[139] a$[178]"" [167] 4500
- 4510 [158]ad[170]15,0
- 4520 [153]"load(NULL)val(NULL)-(NULL)(NULL)val(NULL)(NULL)val(NULL)"
- 4530 [153]" asc1cont - (NULL)rders (NULL)(NULL)right$chr$(NULL)(NULL) to calculate"
- 4540 [153]"unknown parts."
- 4550 [153]" asc3cont - lenycles thru circular units."
- 4560 [153]" len(NULL)(NULL)cont - lenlears all registers in pre-"
- 4570 [153]"aration for a new problem."
- 4580 [153]" (NULL)cont - (NULL)uit (NULL)(NULL)right$chr$(NULL)(NULL) and return to (NULL)(NULL)atnstr$(NULL)(NULL)atn(NULL)."
- 4590 [153]" (NULL)cont - (NULL)end solution to printer."
- 4600 [153]" left$cont - lenalls these screens."
- 4610 [153]" (NULL)val(NULL)(NULL)(NULL)(NULL)cont must be pressed to enter the"
- 4620 [153]" new value into memory, otherwise"
- 4630 [153]" the previous value is retained."
- 4640 [153]" valntering a value of zero (0) will"
- 4650 [153]" clear that part. (NULL)ee the docs for "
- 4660 [153]" worked examples."
- 4670 [153]"def >>> (NULL)ress any key <<< wait";:[151] 198,0:[158]ad[170]15,1
- 4680 [161] a$:[139] a$[178]"" [167] 4680
- 4690 [158]ad[170]15,0:[153]"sysload":[158]ad[170]12,3:[158]ad:[151]214,ys:[151]211,xs:[158] 58732
- 4700 [158]ad[170]18,12,12,7:[158]ad:[151]214,ys
- 4710 [158]ad[170]15,1:[158]ad:[151]646,cs:[142]
- 4720 [143] sysad+18,12,1,0
- 4730 v1[178][194](56576):v2[178][194](53272):[153]"load"
- 4740 [151]56578,[194](56578)[176]3:v0[178][194](56578)
- 4750 [151]56576,([194](56576)[175]252)[176]0
- 4760 [151]53272,([194](53272)[175]15)[176]48
- 4770 [151] 648,204
- 4780 [153]"loadprint stop printwait ghstop printwait stop defwait ";
- 4790 [153]" sys print '( sys stop syswait ";
- 4800 [153]" print ascchr$left$right$mid$ sys tuvwxyz[sys ]^sys tuvwxyz[\]^_syswait ";
- 4810 [153]"poke sys printtofnspc( not +-* sys (NULL)(NULL)sys 89:;sys =>sys 456789:;<=>";
- 4820 [153]"?syswait print de hi klmwait sys def(NULL)(NULL)sys def(NULL)(NULL)(NULL)(NULL)sys def(NULL)(NULL)sys def(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)";
- 4830 [153]"(NULL)(NULL)(NULL)(NULL)(NULL)syswait print!#$ wait@ -./wait sys defintabsprint deffrepossqrrndsys defexpcossys defsgnintabs";
- 4840 [153]"usrfrepossqrrndlogexpcossinsyswait printpeeklenstr$valascchr$left$right$mid$(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)syswait ";
- 4850 [153]" print notstepwait poke";
- 4860 [153]"freloglogloglogloglogloglogloglogloglogloglogloglogloglogloglogloglogloglogloglogloglogloglogloglogloglogloglogloglogposcoswait ";
- 4870 [153]" sinintabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabs";
- 4880 [153]"absabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsusrcossyswait cont(NULL)right$str$val(NULL)sys ";
- 4890 [153]"contatn(NULL)chr$(NULL)val(NULL) clr( str$str$ )sys pokesincossyswait cont sys cont sys ";
- 4900 [153]" pokesincossyswait conta=sys cont atn=sys ";
- 4910 [153]" pokesincossyswait cont sys cont sys ";
- 4920 [153]" pokesincossyswait contb=sys cont peek=sys ";
- 4930 [153]" pokesincossyswait cont sys cont sys ";
- 4940 [153]" pokesincossyswait contc=sys cont len=sys ";
- 4950 [153]" pokesincossyswait cont sys ";
- 4960 [153]" pokesincossyswait contatnrea=sys poke";
- 4970 [153]"sincossyswait pokesincossyswait ";
- 4980 [153]"contha=sys pokesincossyswait conthb=";
- 4990 [153]"sys pokesincossyswait conthc=sys ";
- 5000 [153]" pokesinsqrexpexpexpexpexpexpexpexpexpexpexpexpexpexpexp";
- 5010 [153]"expexpexpexpexpexpexpexpexpexpexpexpexpexpexpexpexpexpexpexpexpexpexp"
- 5020 [151]53280,11:[151]53281,00:[151]53223,251:[151]56295,11
- 5030 [151]53282,04:[151]53283,04:[151]53284,05
- 5040 [158]ad[170]6:[158]ad:[158]ad[170]15,1:[142]
- 5050 [172][172][172] [153]er [129]mat subrs [172][172][172]
- 5060 [139] cu[178]2 [167] 5080
- 5070 [153]fr$(a,1,b);:[142]
- 5080 [129] n[178]1 [164] [195](fr$(a,1,b))
- 5090 [139] [202](fr$(a,1,b),n,1)[178]"-"[167] [153]"d ";:[130]:[142]
- 5100 [139] [202](fr$(a,1,b),n,1)[178]"<"[167] [153]"m ";:[130]:[142]
- 5110 [139] [202](fr$(a,1,b),n,1)[178]">"[167] [153]"s";:[130]:[142]
- 5120 [153][202](fr$(a,1,b),n,1);:[130]:[142]
- 5130 k[178](fr(a,0,0)[170]fr(a,0,1)[170]fr(a,0,2))[173]2
- 5140 k(a)[178][186](k[172](k[171]fr(a,0,0))[172](k[171]fr(a,0,1))[172](k[171]fr(a,0,2))):[153]k(a);:[142]
- 5150 [139] fr(a,0,b)[178]0 [167] [142]
- 5160 [153]2[172]k(a)[173]fr(a,0,b);:[142]
- 10000 [159]15,8,15,"s0:trigon":[160]15:[148]"trigon",8:[128]
- 40000 a$[178]"hello connect":[129]i[178]8[164]9:[160]2:[159]2,i,2:[160]2:[139]st[167]40020
- 40010 [160]15:[159]15,i,15,"r0:"[170]a$[170]"="[170]a$:[132]15,er:[160]15:[139]er[178]63[167]40030
- 40020 [130]:[153]"load":[151]2048,0:[151]44,8:[151]53272,23:[151]186,8:[128]
- 40030 [151]646,[194](53281):[153]"loadload"[199](34)a$[199](34)","i
- 40040 [153]"run":[151]44,8:[151]2048,0:[151]631,13:[151]632,13:[151]198,2:[128]
- 60000 [153]"load":z$[178]" print# ":[151]214,10:[153]
- 60010 [153]" listfrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefre":[129]i[178]0[164]11:[153]z$:[130]
- 60020 [153]" pokeposposposposposposposposposposposposposposposposposposposposposposposposposposposposposposposposposposposposposposprint#"
- 60030 z$(0)[178]"(NULL) (NULL) right$ chr$ (NULL) (NULL)":z$(1)[178]"by (NULL)ichael mid$. chr$ulyas
- 60040 z$(2)="([195]) 1994 by [211]oftdisk [208]ublishing"+chr$(13)
- 60050 z$(3)="[212]his program is the copyrighted work
- 60060 z$(4)[178]"of (NULL)(NULL)asc(NULL)str$right$(NULL)(NULL) (NULL)(NULL)peek(NULL)right$(NULL)left$right$(NULL)chr$. right$t is not"
- 60070 z$(5)[178]"shareware or in the public domain."
- 60080 z$(6)[178]"(NULL)eport illegal distribution of":z$(7)[178]"this program by calling"
- 60090 z$(8)[178]"1-318-221-8718.":[151]214,12:[153]
- 60100 [129]i[178]0[164]8:[153][163]20[171]([195](z$(i))[173]2))""z$(i):[130]:[142]
-