home *** CD-ROM | disk | FTP | other *** search
/ Input 64 / Input_64_85-03_1985_Verlag_Heinz_Weise_de.d64 / formelplotter (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  14KB  |  359 lines

  1. 1 :poke50257,16:poke50258,64
  2. 2 ifpeek(50255)<255thenpoke50255,peek(50255)+1
  3. 3 printchr$(142);chr$(8)
  4. 4 poke50259,1:poke50260,8:poke50261,064:poke50262,046
  5. 10 sys10752:poke55,0:poke56,128:poke45,0:poke46,64:clr
  6. 30 sys32864
  7. 40 ka=0:fe=0:fa=0:ft=0:poke252,0
  8. 50 print"[147]";:poke53280,7:poke53281,7:print"[144]";
  9. 60 poke211,6:poke214,10:sys58640
  10. 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]"
  11. 80 print"      [165]* * * c 64 - plott * * *[167]"
  12. 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]"
  13. 95 poke252,0:fori=1to5000:next
  14. 100 poke53280,13:poke53281,13:print"[144]"
  15. 110 print"[147]"
  16. 120 print"  hauptmenue"
  17. 130 print"  [163][163][163][163][163][163][163][163][163][163]"
  18. 140 print:print
  19. 150 print"  funktionseingabe............1"
  20. 160 print
  21. 220 print
  22. 230 print"  funktion plotten............2"
  23. 240 print
  24. 260 poke211,2:poke214,22:sys58640
  25. 270 print"bitte waehlen !! ";
  26. 290 getx$:poke204,0:ifx$=""then290
  27. 292 ifpeek(207)then292
  28. 294 poke204,1
  29. 300 x=asc(x$):ifx<49orx>51then290
  30. 305 x=x-48
  31. 310 printx
  32. 400 onxgoto800,2000
  33. 500 print"[147]":ug=1
  34. 510 print" koordinaten aendern"
  35. 520 print" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  36. 530 print
  37. 540 print" x-koordinate (min): "
  38. 550 print
  39. 560 print" x-koordinate (max): "
  40. 565 ifkn=2then610
  41. 570 print
  42. 580 print" y-koordinate (min): "
  43. 590 print
  44. 600 print" y-koordinate (max): "
  45. 610 z=4:sp=21:gosub10000
  46. 620 xn=val(x1$):t1$=str$(int((xn*10+5)/10))
  47. 622 ifxn>0then610
  48. 630 z=6:sp=21:gosub10000
  49. 640 xx=val(x1$):t2$=str$(int((xx*10+5)/10))
  50. 642 if(xn=0andxx=0)orxx<=xnthen610
  51. 643 ifxx<0then610
  52. 645 ifkn=2thenreturn
  53. 670 z=8:sp=21:gosub10000
  54. 680 yn=val(x1$):t3$=str$(int((yn*10+5)/10))
  55. 681 ifyn>0then670
  56. 682 z=10:sp=21:gosub10000
  57. 684 yx=val(x1$):t4$=str$(int((yx*10+5)/10))
  58. 686 if(yn=0andyx=0)oryn>=yxthen670
  59. 687 ifyx<0then670
  60. 690 return
  61. 800 print"[147]"
  62. 810 poke53280,15:poke53281,15:print"[144]";
  63. 820 print"[147]"
  64. 825 f$="":x1$=""
  65. 830 print" funktionseingabe"
  66. 840 print" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  67. 850 print:poke214,4:poke211,0:sys58640
  68. 860 print"funktion (x)= "f$:z=4:sp=14:x1$=f$
  69. 862 ifx1$=""thengosub12000:goto864
  70. 863 gosub12020
  71. 864 f$=x1$:print"[155]";
  72. 865 p$="":l=len(f$)+14
  73. 866 fori=1to74-l:p$=p$+".":next:p$=":rem"+p$:p1$=p$+"."
  74. 870 print"[147]900deffna(x)="f$;p1$:print:print"910datafna(x)="f$;p$:print
  75. 872 print"run900"
  76. 880 poke198,6:poke631,19:poke632,13:poke633,13:poke634,13:poke635,13:poke636,13
  77. 890 end
  78. 900 deffna(x)=sqr(9-x^2):rem...................................................
  79. 910 datafna(x)=sqr(9-x^2):rem..................................................
  80. 915 x=fna(1)
  81. 920 fe=1:goto100
  82. 1000 print"[147]"
  83. 1005 iffe=1then1060
  84. 1010 print"bitte funktion definieren !!! "
  85. 1020 poke214,20:poke211,2:sys58640
  86. 1030 print"taste druecken"
  87. 1040 getx$:ifx$=""then1040
  88. 1050 goto100
  89. 1060 print" funktionswerte ausgeben":we=1
  90. 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]"
  91. 1080 print:print"bereich fuer 'x'"
  92. 1090 print:ug=0
  93. 1100 print"von: ";
  94. 1110 x1$=""
  95. 1120 getx$:poke204,0:ifx$=""then1120
  96. 1130 ifpeek207)then1130
  97. 1140 poke204,1
  98. 1150 x=asc(x$):ifx=13then1240
  99. 1160 ifx=20andlen(x1$)>=1thenprint"[157] ";:x1$=left$(x1$,len(x1$)-1):goto1210
  100. 1170 ifx=20then1120
  101. 1180 if(x>47andx<58)orx=45orx=46then1200
  102. 1190 goto1120
  103. 1200 x1$=x1$+x$
  104. 1210 poke214,6:poke211,5:sys58640
  105. 1220 printx1$;
  106. 1230 goto1120
  107. 1240 x1=val(x1$)
  108. 1250 print:print
  109. 1260 print"bis: ";
  110. 1265 x1$=""
  111. 1270 getx$:poke204,0:ifx$=""then1270
  112. 1280 ifpeek(207)then1280
  113. 1290 poke204,1
  114. 1300 x=asc(x$):ifx=13then1390
  115. 1310 ifx=20andlen(x1$)>=1thenprint"[157] ";:x1$=left$(x1$,len(x1$)-1):goto1360
  116. 1320 ifx=20then1270
  117. 1330 if(x>47andx<58)orx=45orx=46then1350
  118. 1340 goto1270
  119. 1350 x1$=x1$+x$
  120. 1360 poke214,8:poke211,5:sys58640
  121. 1370 printx1$;
  122. 1380 goto1270
  123. 1390 x2=val(x1$)
  124. 1400 print:print
  125. 1410 print"schrittweite: ";
  126. 1420 x1$=""
  127. 1430 getx$:poke204,0:ifx$=""then1430
  128. 1440 ifpeek(207)then1440
  129. 1450 poke204,1
  130. 1460 x=asc(x$):ifx=13then1550
  131. 1470 ifx=20andlen(x3$)>=1thenprint"[157] ";:x3$=left$(x3$,len(x3$)-1):goto1520
  132. 1480 ifx=20then1430
  133. 1490 if(x>47andx<58)orx=45orx=46then1510
  134. 1500 goto1430
  135. 1510 x3$=x3$+x$
  136. 1520 poke214,10:poke211,15:sys58640
  137. 1530 printx3$;
  138. 1540 goto1430
  139. 1550 sc=val(x3$)
  140. 1560 ifsc=0thensc=1
  141. 1570 restore:print"[144]":readf$:print"[147]"f$:print:print
  142. 1580 print" argument(x)";"         funktionswert":print
  143. 1590 ifx1<x2then1600
  144. 1592 ifsc<0then1600
  145. 1594 sc=sc*-1
  146. 1600 z=0
  147. 1610 fori=x1tox2stepsc
  148. 1620 z=z+1
  149. 1630 sw=10-len(str$(int(i))):poke211,sw:sys58640
  150. 1640 f=fna(i):f=int(f*100000+.0005)/100000:ka=len(str$(fna(i)))
  151. 1642 iff<fmthenfm=f
  152. 1644 iff>fpthenfp=f
  153. 1650 fork=1toka:ifmid$(str$(fna(i)),k,1)="."thenk1=k:goto1680
  154. 1660 ifk=kathenk1=k+1:goto1680
  155. 1670 nextk
  156. 1680 fk$=left$(str$(fna(i)),k1-1)
  157. 1690 printi;:sw=28-len(fk$):poke211,sw:sys58640:printf
  158. 1700 ifz=15thenz=0:gosub11000
  159. 1710 nexti
  160. 1720 poke211,2:poke214,23:sys58640
  161. 1730 print"weiter mit w ";
  162. 1740 getx$:ifx$=""then1740
  163. 1750 ifx$="w"then1770
  164. 1760 goto1740
  165. 1770 goto100
  166. 2000 print"[147]"
  167. 2010 iffe=1then2070
  168. 2020 print"funktion nicht definiert !!"
  169. 2030 poke214,20:poke211,2:sys58640
  170. 2040 print"taste druecken !! ";
  171. 2050 getx$:ifx$=""then2050
  172. 2060 goto100
  173. 2070 gosub7000:m=0:goto4000
  174. 2080 poke56576,peek(56576)and252or2:poke648,68
  175. 2090 poke12544,1
  176. 2100 x1=(xn*-1)+xx
  177. 2102 x2=257/x1*xx
  178. 2104 ifx2>257thenx2=257
  179. 2105 ifx2<0thenx2=0
  180. 2110 sys32960:sys33181:sys33212,0*16+1:sys33014,317-x2,2,317-x2,197
  181. 2130 y1=(yn*-1)+yx:y2=200/y1*yx
  182. 2132 ify2>197theny2=197
  183. 2133 ify2<2theny2=2
  184. 2135 sys33014,60,y2,318,y2
  185. 2138 xp=xn:xq=xx
  186. 2140 ifxp=0thenp1=100/(abs(xp)+xq)*xq:pz=p1/xq:goto2150
  187. 2142 if(abs(xq)/abs(xp))>10thenxp=0:goto2140
  188. 2143 ifabs(xp)>10or(abs(xq)>10)thenxp=xp/10:xq=xq/10
  189. 2144 ifabs(xp)<1or(abs(xq)<1)thenxp=xp*10:xq=xq*10
  190. 2145 p1=100/((xp*-1)+xq)*xp:pz=p1/xp
  191. 2150 p2=257/100*pz:ifp2<10thenp2=p2*10
  192. 2155 sp=-3:sq=3
  193. 2156 ify2<6thensp=0
  194. 2157 ify2>194thensq=0
  195. 2160 fori=317-x2to58step-p2:sys33014,i,y2+sp,i,y2+sq
  196. 2164 next
  197. 2165 fori=317-x2to317stepp2:sys33014,i,y2+sp,i,y2+sq:next
  198. 2166 a1=int(y2/8-1)*320+64+24576
  199. 2167 ifa1<24576+56thena1=24576+64+320
  200. 2168 a2=int(a1/256):a3=a1-(a2*256):poke33671,a3:poke33675,a2
  201. 2169 a1=a1+29*8:ifa1>99thena1=a1-8
  202. 2170 ifa1<24576+320-16thena1=25576+320-24+320
  203. 2171 a2=int(a1/256):a3=a1-(a2*256):poke33698,a3:poke33702,a2
  204. 2174 yp=yn:yq=yx
  205. 2175 ifyp=0thenp1=100/(abs(yp)+yq)*yq:pz=p1/yq:goto2200
  206. 2180 if(abs(yq)/abs(yp))>10thenyp=0:goto2175
  207. 2185 ifabs(yp)>10or(abs(yq)>10)thenyp=yp/10:yq=yq/10
  208. 2190 ifabs(yp)<1or(abs(yq)<1)thenyp=yp*10:yq=yq*10
  209. 2195 p1=100/((yp*-1)+yq)*yp:pz=p1/yp
  210. 2200 p2=197/100*pz:ifp2<10thenp2=p2*10
  211. 2205 sp=-3:sq=3
  212. 2206 ifx2<3thensq=0
  213. 2207 ifx2>257thensp=0
  214. 2210 fori=y2to2step-p2:sys33014,317-x2+sp,i,317-x2+sq,i:next
  215. 2215 fori=y2to199stepp2:sys33014,317-x2+sp,i,317-x2+sq,i:next
  216. 2220 a1=int((317-x2)/8)*8+24576-16+320
  217. 2230 a2=int(a1/256):a3=a1-(a2*256):poke33752,a3:poke33756,a2
  218. 2240 a1=a1+7680-640:a2=int(a1/256):a3=a1-(a2*256):poke33725,a3:poke33729,a2
  219. 3000 sys33654
  220. 3153 xt=x1/257:xk=xn
  221. 3160 fori=60to316
  222. 3170 yp=fna(xn)
  223. 3180 gosub6000
  224. 3190 xn=xn+xt
  225. 3200 next
  226. 3300 getx$:ifx$=""then3300
  227. 3310 sys32983:poke56576,199:poke648,4
  228. 3399 goto100
  229. 4000 bd=12288:l=len(t1$):xd$=t1$:gosub4050
  230. 4010 bd=bd+15:l=len(t2$):xd$=t2$:gosub4050
  231. 4020 bd=bd+15:l=len(t3$):xd$=t3$:gosub4050
  232. 4030 bd=bd+15:l=len(t4$):xd$=t4$:gosub4050
  233. 4040 goto2080
  234. 4050 fori1=bdtobd-1+l
  235. 4060 p=asc(mid$(xd$,(i1-bd)+1,1))
  236. 4062 pokei1,p
  237. 4070 nexti1:pokebd+l,0
  238. 4080 return
  239. 6000 yl=197/y1*yp
  240. 6010 ify2-yl<2ory2-yl>199thenm=0:return
  241. 6100 ifm=0thensys32998,i,y2-yl:m=1:i1=i:ym=yl:return
  242. 6110 sys33014,i1,y2-ym,i,y2-yl
  243. 6120 i1=i:ym=yl
  244. 6130 return
  245. 7000 print"koordinaten definieren ? (j/n) ";
  246. 7010 getx$:poke204,0:ifx$=""then7010
  247. 7020 ifpeek(207)then7020
  248. 7030 poke204,1
  249. 7034 ifx$="n"andkn=1thenxn=xk:t1$=str$(int(xn)):t2$=str$(int(xx))
  250. 7035 ifx$="n"andkn=1thent3$=str$(int(yn)):t4$=str$(int(yx)):return
  251. 7040 ifx$="j"thenkn=1:gosub500:return
  252. 7050 ifx$="n"thenkn=2::print"[147]":print:print:gosub530:goto7160
  253. 7060 goto7010
  254. 7160 yn=0:yx=0
  255. 7170 fori=xntoxxstepxx/10
  256. 7180 a1=fna(i):ifa1<ynthenyn=a1
  257. 7190 ifa1>yxthenyx=a1
  258. 7200 next
  259. 7202 yx=yx+.1:yn=yn-.1
  260. 7204 t3$=str$(int((yn*10+5)/10)):t4$=str$(int((yx*10+5)/10))
  261. 7210 return
  262. 9999 goto100
  263. 10000 poke214,z:poke211,sp:sys58640
  264. 10005 x1$="":print"                   ":poke214,z:poke211,sp:sys58640
  265. 10010 getx$:poke204,0:ifx$=""then10010
  266. 10020 ifpeek(207)then10020
  267. 10021 poke204,1
  268. 10024 ifasc(x$)=20andlen(x1$)>0then10110
  269. 10025 ifasc(x$)=13then10100
  270. 10026 ifasc(x$)=46orasc(x$)=45then10040
  271. 10030 x=asc(x$):ifx<48orx>57then10010
  272. 10040 x1$=x1$+x$
  273. 10050 poke214,z:poke211,sp:sys58640:printx1$;
  274. 10060 goto10010
  275. 10100 return
  276. 10110 x1$=left$(x1$,len(x1$)-1)
  277. 10120 print"[157] ";
  278. 10130 goto10050
  279. 11000 poke211,0:poke214,23:sys58640
  280. 11010 print"taste druecken";
  281. 11020 getx$:ifx$=""then11020
  282. 11030 poke214,4:poke211,0:fori1=4to23
  283. 11040 print"                                       "
  284. 11050 next
  285. 11060 poke211,0:poke214,5:sys58640
  286. 11070 return
  287. 12000 rem initialisieren
  288. 12010 poke214,z:poke211,sp:sys58640:fp=0:poke650,64:z=0:z1=0:z2=0:goto12040
  289. 12020 poke214,z:poke211,sp:sys58640:poke650,64:z=len(x1$):z1=0:z2=z:fp=1
  290. 12040 sys32824
  291. 12050 wt=peek(254)
  292. 12060 x$=chr$(wt)
  293. 12070 ifwt=13then12510
  294. 12080 ifwt=20orwt=29orwt=157orwt=148then12180
  295. 12090 ifwt=32orwt=222then12125
  296. 12100 ifwt=58orwt=59orwt=63orwt=64orwt=92orwt=91orwt=93orwt=95then12040
  297. 12110 ifwt<40orwt>95then12040
  298. 12120 iffp=1then12440
  299. 12125 ifz>=25thenz=25:goto12040
  300. 12130 x1$=x1$+x$
  301. 12140 z=z+1
  302. 12150 z1=z1+1
  303. 12160 printx$;
  304. 12170 goto12040
  305. 12180 ifwt=157then12230
  306. 12190 ifwt=29then12260
  307. 12200 ifwt=20then12290
  308. 12210 ifwt=148then12380
  309. 12220 goto12040
  310. 12230 z1=z1-1
  311. 12240 ifz1<0thenz1=0:goto12040
  312. 12250 goto12160
  313. 12260 z1=z1+1:ifz2>0thenz2=z2-1
  314. 12270 ifz1>zthenz1=z:goto12040
  315. 12275 ifz2=0thenfp=0
  316. 12280 goto12160
  317. 12290 ifz1=0then12040
  318. 12300 x2$=left$(x1$,z1-1)
  319. 12310 xx$=x1$
  320. 12320 x3$=right$(x1$,z-z1)
  321. 12330 x1$=x2$+x3$
  322. 12340 z=z-1
  323. 12350 z1=z1-1
  324. 12360 ifz1<0thenz1=0:z=z+1:x1$=xx$:goto12040
  325. 12370 goto12160
  326. 12380 ifz1=zthen12040
  327. 12385 fp=1:x2$=left$(x1$,z1)
  328. 12390 x3$=right$(x1$,z-z1)
  329. 12400 x2$=x2$+" ":x1$=x2$+x3$
  330. 12410 z=z+1:z2=z2+1
  331. 12420 ifz>25thenz=25:goto12040
  332. 12430 goto12160
  333. 12440 x2$=left$(x1$,z1)
  334. 12450 x2$=x2$+x$
  335. 12460 x1$=x2$+right$(x1$,z-z1-1)
  336. 12470 z1=z1+1
  337. 12480 z2=z2-1
  338. 12490 ifz2=0thenfp=0
  339. 12500 goto12160
  340. 12510 poke650,0:return
  341. 50000 rem ifxx<>0then50005
  342. 50002 dimfl$(20)
  343. 50005 print"[144]"
  344. 50010 fl$(1)="syntax-fehler":fl$(4)="ungueltige werteeingabe"
  345. 50020 fl$(5)="ergebnis zu gross":fl$(6)="speicher voll"
  346. 50030 fl$(10)="teilen durch null ist nicht erlaubt":fl$(15)="formel zu komplex"
  347. 50040 fl=peek(251):ifpeek(12544)=1thensys32983:poke56576,199:poke648,4
  348. 50050 fl=0:iffl>10thenfl=fl-10
  349. 50060 restore:readf$:l=len(f$):l1=l-7:f$=mid$(f$,8,l1)
  350. 50070 poke214,7:poke211,0:sys58640:print"[144]"fl$(fl)
  351. 50075 iffl=1orfl=15orfl=10orfl=5thenpoke251,0
  352. 50080 iffl=1orfl=15orfl=10orfl=5thenpoke214,1:poke211,0:sys58640:goto830
  353. 50090 iffl=4andug=1thenpoke251,0:500
  354. 50092 iffl=4andug=0thenpoke251,0:goto1000
  355. 50100 iffl=6thenclr:poke251,0
  356. 50180 poke214,20:poke211,2:sys58640:print"taste druecken !! ";
  357. 50190 getx$:ifx$=""then50190
  358. 50200 poke251,0:goto100
  359.