home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Input 64
/
Input_64_85-03_1985_Verlag_Heinz_Weise_de.d64
/
formelplotter
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
14KB
|
359 lines
1 :poke50257,16:poke50258,64
2 ifpeek(50255)<255thenpoke50255,peek(50255)+1
3 printchr$(142);chr$(8)
4 poke50259,1:poke50260,8:poke50261,064:poke50262,046
10 sys10752:poke55,0:poke56,128:poke45,0:poke46,64:clr
30 sys32864
40 ka=0:fe=0:fa=0:ft=0:poke252,0
50 print"[147]";:poke53280,7:poke53281,7:print"[144]";
60 poke211,6:poke214,10:sys58640
70 print"[207][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][208]"
80 print" [165]* * * c 64 - plott * * *[167]"
90 print" [204][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][186]"
95 poke252,0:fori=1to5000:next
100 poke53280,13:poke53281,13:print"[144]"
110 print"[147]"
120 print" hauptmenue"
130 print" [163][163][163][163][163][163][163][163][163][163]"
140 print:print
150 print" funktionseingabe............1"
160 print
220 print
230 print" funktion plotten............2"
240 print
260 poke211,2:poke214,22:sys58640
270 print"bitte waehlen !! ";
290 getx$:poke204,0:ifx$=""then290
292 ifpeek(207)then292
294 poke204,1
300 x=asc(x$):ifx<49orx>51then290
305 x=x-48
310 printx
400 onxgoto800,2000
500 print"[147]":ug=1
510 print" koordinaten aendern"
520 print" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
530 print
540 print" x-koordinate (min): "
550 print
560 print" x-koordinate (max): "
565 ifkn=2then610
570 print
580 print" y-koordinate (min): "
590 print
600 print" y-koordinate (max): "
610 z=4:sp=21:gosub10000
620 xn=val(x1$):t1$=str$(int((xn*10+5)/10))
622 ifxn>0then610
630 z=6:sp=21:gosub10000
640 xx=val(x1$):t2$=str$(int((xx*10+5)/10))
642 if(xn=0andxx=0)orxx<=xnthen610
643 ifxx<0then610
645 ifkn=2thenreturn
670 z=8:sp=21:gosub10000
680 yn=val(x1$):t3$=str$(int((yn*10+5)/10))
681 ifyn>0then670
682 z=10:sp=21:gosub10000
684 yx=val(x1$):t4$=str$(int((yx*10+5)/10))
686 if(yn=0andyx=0)oryn>=yxthen670
687 ifyx<0then670
690 return
800 print"[147]"
810 poke53280,15:poke53281,15:print"[144]";
820 print"[147]"
825 f$="":x1$=""
830 print" funktionseingabe"
840 print" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
850 print:poke214,4:poke211,0:sys58640
860 print"funktion (x)= "f$:z=4:sp=14:x1$=f$
862 ifx1$=""thengosub12000:goto864
863 gosub12020
864 f$=x1$:print"[155]";
865 p$="":l=len(f$)+14
866 fori=1to74-l:p$=p$+".":next:p$=":rem"+p$:p1$=p$+"."
870 print"[147]900deffna(x)="f$;p1$:print:print"910datafna(x)="f$;p$:print
872 print"run900"
880 poke198,6:poke631,19:poke632,13:poke633,13:poke634,13:poke635,13:poke636,13
890 end
900 deffna(x)=sqr(9-x^2):rem...................................................
910 datafna(x)=sqr(9-x^2):rem..................................................
915 x=fna(1)
920 fe=1:goto100
1000 print"[147]"
1005 iffe=1then1060
1010 print"bitte funktion definieren !!! "
1020 poke214,20:poke211,2:sys58640
1030 print"taste druecken"
1040 getx$:ifx$=""then1040
1050 goto100
1060 print" funktionswerte ausgeben":we=1
1070 print" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
1080 print:print"bereich fuer 'x'"
1090 print:ug=0
1100 print"von: ";
1110 x1$=""
1120 getx$:poke204,0:ifx$=""then1120
1130 ifpeek207)then1130
1140 poke204,1
1150 x=asc(x$):ifx=13then1240
1160 ifx=20andlen(x1$)>=1thenprint"[157] ";:x1$=left$(x1$,len(x1$)-1):goto1210
1170 ifx=20then1120
1180 if(x>47andx<58)orx=45orx=46then1200
1190 goto1120
1200 x1$=x1$+x$
1210 poke214,6:poke211,5:sys58640
1220 printx1$;
1230 goto1120
1240 x1=val(x1$)
1250 print:print
1260 print"bis: ";
1265 x1$=""
1270 getx$:poke204,0:ifx$=""then1270
1280 ifpeek(207)then1280
1290 poke204,1
1300 x=asc(x$):ifx=13then1390
1310 ifx=20andlen(x1$)>=1thenprint"[157] ";:x1$=left$(x1$,len(x1$)-1):goto1360
1320 ifx=20then1270
1330 if(x>47andx<58)orx=45orx=46then1350
1340 goto1270
1350 x1$=x1$+x$
1360 poke214,8:poke211,5:sys58640
1370 printx1$;
1380 goto1270
1390 x2=val(x1$)
1400 print:print
1410 print"schrittweite: ";
1420 x1$=""
1430 getx$:poke204,0:ifx$=""then1430
1440 ifpeek(207)then1440
1450 poke204,1
1460 x=asc(x$):ifx=13then1550
1470 ifx=20andlen(x3$)>=1thenprint"[157] ";:x3$=left$(x3$,len(x3$)-1):goto1520
1480 ifx=20then1430
1490 if(x>47andx<58)orx=45orx=46then1510
1500 goto1430
1510 x3$=x3$+x$
1520 poke214,10:poke211,15:sys58640
1530 printx3$;
1540 goto1430
1550 sc=val(x3$)
1560 ifsc=0thensc=1
1570 restore:print"[144]":readf$:print"[147]"f$:print:print
1580 print" argument(x)";" funktionswert":print
1590 ifx1<x2then1600
1592 ifsc<0then1600
1594 sc=sc*-1
1600 z=0
1610 fori=x1tox2stepsc
1620 z=z+1
1630 sw=10-len(str$(int(i))):poke211,sw:sys58640
1640 f=fna(i):f=int(f*100000+.0005)/100000:ka=len(str$(fna(i)))
1642 iff<fmthenfm=f
1644 iff>fpthenfp=f
1650 fork=1toka:ifmid$(str$(fna(i)),k,1)="."thenk1=k:goto1680
1660 ifk=kathenk1=k+1:goto1680
1670 nextk
1680 fk$=left$(str$(fna(i)),k1-1)
1690 printi;:sw=28-len(fk$):poke211,sw:sys58640:printf
1700 ifz=15thenz=0:gosub11000
1710 nexti
1720 poke211,2:poke214,23:sys58640
1730 print"weiter mit w ";
1740 getx$:ifx$=""then1740
1750 ifx$="w"then1770
1760 goto1740
1770 goto100
2000 print"[147]"
2010 iffe=1then2070
2020 print"funktion nicht definiert !!"
2030 poke214,20:poke211,2:sys58640
2040 print"taste druecken !! ";
2050 getx$:ifx$=""then2050
2060 goto100
2070 gosub7000:m=0:goto4000
2080 poke56576,peek(56576)and252or2:poke648,68
2090 poke12544,1
2100 x1=(xn*-1)+xx
2102 x2=257/x1*xx
2104 ifx2>257thenx2=257
2105 ifx2<0thenx2=0
2110 sys32960:sys33181:sys33212,0*16+1:sys33014,317-x2,2,317-x2,197
2130 y1=(yn*-1)+yx:y2=200/y1*yx
2132 ify2>197theny2=197
2133 ify2<2theny2=2
2135 sys33014,60,y2,318,y2
2138 xp=xn:xq=xx
2140 ifxp=0thenp1=100/(abs(xp)+xq)*xq:pz=p1/xq:goto2150
2142 if(abs(xq)/abs(xp))>10thenxp=0:goto2140
2143 ifabs(xp)>10or(abs(xq)>10)thenxp=xp/10:xq=xq/10
2144 ifabs(xp)<1or(abs(xq)<1)thenxp=xp*10:xq=xq*10
2145 p1=100/((xp*-1)+xq)*xp:pz=p1/xp
2150 p2=257/100*pz:ifp2<10thenp2=p2*10
2155 sp=-3:sq=3
2156 ify2<6thensp=0
2157 ify2>194thensq=0
2160 fori=317-x2to58step-p2:sys33014,i,y2+sp,i,y2+sq
2164 next
2165 fori=317-x2to317stepp2:sys33014,i,y2+sp,i,y2+sq:next
2166 a1=int(y2/8-1)*320+64+24576
2167 ifa1<24576+56thena1=24576+64+320
2168 a2=int(a1/256):a3=a1-(a2*256):poke33671,a3:poke33675,a2
2169 a1=a1+29*8:ifa1>99thena1=a1-8
2170 ifa1<24576+320-16thena1=25576+320-24+320
2171 a2=int(a1/256):a3=a1-(a2*256):poke33698,a3:poke33702,a2
2174 yp=yn:yq=yx
2175 ifyp=0thenp1=100/(abs(yp)+yq)*yq:pz=p1/yq:goto2200
2180 if(abs(yq)/abs(yp))>10thenyp=0:goto2175
2185 ifabs(yp)>10or(abs(yq)>10)thenyp=yp/10:yq=yq/10
2190 ifabs(yp)<1or(abs(yq)<1)thenyp=yp*10:yq=yq*10
2195 p1=100/((yp*-1)+yq)*yp:pz=p1/yp
2200 p2=197/100*pz:ifp2<10thenp2=p2*10
2205 sp=-3:sq=3
2206 ifx2<3thensq=0
2207 ifx2>257thensp=0
2210 fori=y2to2step-p2:sys33014,317-x2+sp,i,317-x2+sq,i:next
2215 fori=y2to199stepp2:sys33014,317-x2+sp,i,317-x2+sq,i:next
2220 a1=int((317-x2)/8)*8+24576-16+320
2230 a2=int(a1/256):a3=a1-(a2*256):poke33752,a3:poke33756,a2
2240 a1=a1+7680-640:a2=int(a1/256):a3=a1-(a2*256):poke33725,a3:poke33729,a2
3000 sys33654
3153 xt=x1/257:xk=xn
3160 fori=60to316
3170 yp=fna(xn)
3180 gosub6000
3190 xn=xn+xt
3200 next
3300 getx$:ifx$=""then3300
3310 sys32983:poke56576,199:poke648,4
3399 goto100
4000 bd=12288:l=len(t1$):xd$=t1$:gosub4050
4010 bd=bd+15:l=len(t2$):xd$=t2$:gosub4050
4020 bd=bd+15:l=len(t3$):xd$=t3$:gosub4050
4030 bd=bd+15:l=len(t4$):xd$=t4$:gosub4050
4040 goto2080
4050 fori1=bdtobd-1+l
4060 p=asc(mid$(xd$,(i1-bd)+1,1))
4062 pokei1,p
4070 nexti1:pokebd+l,0
4080 return
6000 yl=197/y1*yp
6010 ify2-yl<2ory2-yl>199thenm=0:return
6100 ifm=0thensys32998,i,y2-yl:m=1:i1=i:ym=yl:return
6110 sys33014,i1,y2-ym,i,y2-yl
6120 i1=i:ym=yl
6130 return
7000 print"koordinaten definieren ? (j/n) ";
7010 getx$:poke204,0:ifx$=""then7010
7020 ifpeek(207)then7020
7030 poke204,1
7034 ifx$="n"andkn=1thenxn=xk:t1$=str$(int(xn)):t2$=str$(int(xx))
7035 ifx$="n"andkn=1thent3$=str$(int(yn)):t4$=str$(int(yx)):return
7040 ifx$="j"thenkn=1:gosub500:return
7050 ifx$="n"thenkn=2::print"[147]":print:print:gosub530:goto7160
7060 goto7010
7160 yn=0:yx=0
7170 fori=xntoxxstepxx/10
7180 a1=fna(i):ifa1<ynthenyn=a1
7190 ifa1>yxthenyx=a1
7200 next
7202 yx=yx+.1:yn=yn-.1
7204 t3$=str$(int((yn*10+5)/10)):t4$=str$(int((yx*10+5)/10))
7210 return
9999 goto100
10000 poke214,z:poke211,sp:sys58640
10005 x1$="":print" ":poke214,z:poke211,sp:sys58640
10010 getx$:poke204,0:ifx$=""then10010
10020 ifpeek(207)then10020
10021 poke204,1
10024 ifasc(x$)=20andlen(x1$)>0then10110
10025 ifasc(x$)=13then10100
10026 ifasc(x$)=46orasc(x$)=45then10040
10030 x=asc(x$):ifx<48orx>57then10010
10040 x1$=x1$+x$
10050 poke214,z:poke211,sp:sys58640:printx1$;
10060 goto10010
10100 return
10110 x1$=left$(x1$,len(x1$)-1)
10120 print"[157] ";
10130 goto10050
11000 poke211,0:poke214,23:sys58640
11010 print"taste druecken";
11020 getx$:ifx$=""then11020
11030 poke214,4:poke211,0:fori1=4to23
11040 print" "
11050 next
11060 poke211,0:poke214,5:sys58640
11070 return
12000 rem initialisieren
12010 poke214,z:poke211,sp:sys58640:fp=0:poke650,64:z=0:z1=0:z2=0:goto12040
12020 poke214,z:poke211,sp:sys58640:poke650,64:z=len(x1$):z1=0:z2=z:fp=1
12040 sys32824
12050 wt=peek(254)
12060 x$=chr$(wt)
12070 ifwt=13then12510
12080 ifwt=20orwt=29orwt=157orwt=148then12180
12090 ifwt=32orwt=222then12125
12100 ifwt=58orwt=59orwt=63orwt=64orwt=92orwt=91orwt=93orwt=95then12040
12110 ifwt<40orwt>95then12040
12120 iffp=1then12440
12125 ifz>=25thenz=25:goto12040
12130 x1$=x1$+x$
12140 z=z+1
12150 z1=z1+1
12160 printx$;
12170 goto12040
12180 ifwt=157then12230
12190 ifwt=29then12260
12200 ifwt=20then12290
12210 ifwt=148then12380
12220 goto12040
12230 z1=z1-1
12240 ifz1<0thenz1=0:goto12040
12250 goto12160
12260 z1=z1+1:ifz2>0thenz2=z2-1
12270 ifz1>zthenz1=z:goto12040
12275 ifz2=0thenfp=0
12280 goto12160
12290 ifz1=0then12040
12300 x2$=left$(x1$,z1-1)
12310 xx$=x1$
12320 x3$=right$(x1$,z-z1)
12330 x1$=x2$+x3$
12340 z=z-1
12350 z1=z1-1
12360 ifz1<0thenz1=0:z=z+1:x1$=xx$:goto12040
12370 goto12160
12380 ifz1=zthen12040
12385 fp=1:x2$=left$(x1$,z1)
12390 x3$=right$(x1$,z-z1)
12400 x2$=x2$+" ":x1$=x2$+x3$
12410 z=z+1:z2=z2+1
12420 ifz>25thenz=25:goto12040
12430 goto12160
12440 x2$=left$(x1$,z1)
12450 x2$=x2$+x$
12460 x1$=x2$+right$(x1$,z-z1-1)
12470 z1=z1+1
12480 z2=z2-1
12490 ifz2=0thenfp=0
12500 goto12160
12510 poke650,0:return
50000 rem ifxx<>0then50005
50002 dimfl$(20)
50005 print"[144]"
50010 fl$(1)="syntax-fehler":fl$(4)="ungueltige werteeingabe"
50020 fl$(5)="ergebnis zu gross":fl$(6)="speicher voll"
50030 fl$(10)="teilen durch null ist nicht erlaubt":fl$(15)="formel zu komplex"
50040 fl=peek(251):ifpeek(12544)=1thensys32983:poke56576,199:poke648,4
50050 fl=0:iffl>10thenfl=fl-10
50060 restore:readf$:l=len(f$):l1=l-7:f$=mid$(f$,8,l1)
50070 poke214,7:poke211,0:sys58640:print"[144]"fl$(fl)
50075 iffl=1orfl=15orfl=10orfl=5thenpoke251,0
50080 iffl=1orfl=15orfl=10orfl=5thenpoke214,1:poke211,0:sys58640:goto830
50090 iffl=4andug=1thenpoke251,0:500
50092 iffl=4andug=0thenpoke251,0:goto1000
50100 iffl=6thenclr:poke251,0
50180 poke214,20:poke211,2:sys58640:print"taste druecken !! ";
50190 getx$:ifx$=""then50190
50200 poke251,0:goto100