home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er Special 87
/
64er_Magazin_Sonderheft_87_19xx_Markt__Technik_de_Side_A.d64
/
graphiccharts
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
12KB
|
519 lines
87 c=6:x=37
88 ba=24:dimbb(ba),z$(ba),n(ba),p(ba),b(ba),bb$(ba),j$(ba):a=12:h=160:h1=155:v=1
89 dimee$(ba),p$(ba):fc$="0123456789"
90 ft$="abcdefghijklmnopqrstuvwxyz[193][194][195][196][197][198][199][200][201][202][203][204][205][206][207][208][209][210][212][211][212][213][214][215][216][217][218] 0123456789.,:;/-+"
100 C\0,3,3
150 rem hauptmenue
160 Cx:Cy:Cv" [195] [200] [193] [210] [212] [211] & [208] [201] [197] [211] [146]"
165 print C(2,1);"(nur mit [211][208][197][195][201][193][204] [194][193][211][201][195] lauffaehig)"
170 print:Cv"[200]auptmenue"
180 print
190 print" [201] [146] [201]nfos zum [208]rogramm"
200 print:print" [198]1 [146] [194]alken +- variabel (1-24)"
210 print:print" [198]3 [146] [194]alken 3[196] variabel (1-12)"
220 print:print" [198]5 [146] [208]areto % variabel (1-12)"
230 print:print" [198]7 [146] [205]uenzen- variabel (1- 6)"
240 print:print" [198]2 [146] [204]inien + -variabel (1-24)"
250 print:print" [198]4 [146] [212]ortengrafik (1- 6)"
255 print:print" [198]6 [146] [196]irectory"
260 print:print" [197] [146] [197][206][196][197]":print
270 e$="[212]aste druecken!"
280 Cu14,23,e$
290 C;
295 CJ 6,10
300 Ctx$:poke646,0:CJ
310 :Ck x$
320 : Cm "i":Ce information
330 : Cm chr$(133):Ce balken-linien
340 : Cm chr$(134):Ce 3d-balken
350 : Cm chr$(135):Ce pareto
360 : Cm chr$(136):Ce muenzen
370 : Cm chr$(137):Ce balken-linien
380 : Cm chr$(138):Ce torte
385 : Cm chr$(139):Cy:CV:wait 198,1:goto160
390 : Cm "e":Ce ende
400 :Cl
405 C@ x$=""
410 Cd ende
412 Cy:Cv"'charts & pies' beenden."
413 end
414 Cg
420 Cd information
430 Cy:Cv" [201][206][198][207][211] [146]":print:print
440 print"[196]er gewaehlte [199]rafiktyp erscheint mit"
450 print"entsprechenden [215]erten auf dem [211]creen."
460 print
470 print"[200]ires-[200]ardcopy: [198]1 [146]"
480 print"[215]erteliste wird unten an die [199]rafik"
490 print"angefuegt. [196]er [196]rucker muss seriell mit"
492 print"dem [195] 64 verbunden sein ([196][201][206]-[203]abel oder"
494 print"[200]ardware-[201]nterface (z.[194]. [215]iesemann)."
495 print"[200]ires-[199]rafik speichern: [198]3 [146]"
496 print"[196]ie [211]tatistikgrafik wird als [200]ires-[196]atei";
497 print"auf [196]iskette abgelegt."
498 print"[196]iese [198]unktion kann nur vor dem [196]rucken"
499 print"aufgerufen werden!"
501 print C(15,20);"<[212][193][211][212][197]>"
502 Ctx$:goto100
520 Cg
670 Cd 3d-balken
672 Cy:print"'.dat'-[196]atei laden (j/n)";:Cs ft$,1,tx$
673 iftx$="n"then680
674 print"[198]ilename (ohne '.dat'): ";:Cs ft$,12,fi$
675 Ce loaddata
676 ifba>12 then ba=12
677 goto701
680 print"[215]ieviele [208]osten (max.12):";:Cs fc$,2,ba$:ba=val(ba$)
690 ifba<1orba>12thenprint"unerlaubte [197]ingabe!":Dq2:goto680
700 Ce eingabe
701 Ce eingabe2
710 Ce maxvwert
720 Ce diagramm
730 Cta$
740 ifa$=chr$(134)thenC8
742 Ce graphsave
743 poke198,0:goto730
745 C:
750 ifa$=chr$(133)thenC8
753 Ce D%hardcopy
754 Ce listendruck
756 C:
790 run
791 Cg
800 Cd balken-linien
802 Cy:print"'.dat'-[196]atei laden (j/n)";:Cs ft$,1,tx$
803 iftx$="n"then810
804 print"[198]ilename (ohne '.dat'): ";:Cs ft$,12,fi$
805 Ce loaddata
806 goto831
810 Cy:print"[215]ieviele [208]osten (max.24):";:Cs fc$,2,ba$:ba=val(ba$)
820 ifba<1orba>24thenprint"unerlaubter [215]ert[146]":Dq2:goto810
830 Ce eingabe
831 Ce eingabe2
840 rem stapelgroesse optimieren
850 g=0:t=200000:ss=1
860 fori=1toba
870 ifss=1theng=p(i):t=p(i):ss=2
880 ifsgn(p(i))=-1thenp(i)=p(i)*-1
890 ifp(i)<tthent=p(i)
900 ifp(i)>gtheng=p(i)
910 nexti:rem g= groesster wert p
920 fori=1toba:n(i)=int(80*bb(i)/g):nexti:rem mass-stab balken optimieren
930 f=int(g/5)
940 Ce bldiagramm
950 Cta$
951 ifa$=chr$(134)thenC8
952 Ce graphsave
953 poke198,0:goto950
954 C:
970 ifa$=chr$(133)thenC8
972 Ce D%hardcopy
973 Ce azliste
975 C:
1010 run
1011 Cg
1020 Cd pareto
1022 Cy:print"'.dat'-[196]atei laden (j/n)";:Cs ft$,1,tx$
1023 iftx$="n"then1030
1024 print"[198]ilename (ohne '.dat'): ";:Cs ft$,12,fi$
1025 Ce loaddata
1026 ifba>12 then ba=12
1027 goto1051
1030 Cy:print"[215]ieviele [208]osten (max.12):";:Cs fc$,2,ba$:ba=val(ba$)
1040 ifba<1orba>12thenprint"unerlaubter [215]ert[146]":Dq2:goto1030
1050 Ce eingabe
1051 Ce eingabe2
1060 print:print"[211]ortierung[146]"
1070 Ce sortierung
1090 g=su
1100 fori=1toba:n(i)=int(120*val(bb$(i))/g):next
1110 f=10
1111 Ce paretodiagramm
1120 Cta$
1121 ifa$=chr$(134)thenC8
1122 Ce graphsave
1123 poke198,0:goto1120
1124 C:
1140 ifa$=chr$(133)thenC8
1142 Ce D%hardcopy
1143 Ce listendruck
1145 C:
1180 run
1181 Cg
1190 Cd muenzen
1192 Cy:print"'.dat'-[196]atei laden (j/n)";:Cs ft$,1,tx$
1193 iftx$="n"then1200
1194 print"[198]ilename (ohne '.dat'): ";:Cs ft$,12,fi$
1195 Ce loaddata
1196 ifba>6 then ba=6
1197 goto1221
1200 Cy:print"[215]ieviele [208]osten (max.6):";:Cs fc$,1,ba$:ba=val(ba$)
1210 ifba<1orba>6thenprint"unerlaubter [215]ert.":Dq2:goto1200
1220 Ce eingabe
1221 Ce eingabe2
1230 rem stapelgroesse optimieren
1240 g=0:t=200000:ss=1
1250 fori=1toba
1260 ifss=1theng=p(i):t=p(i):ss=2
1270 ifp(i)<tthent=p(i)
1280 ifp(i)>gtheng=p(i)
1290 nexti:rem g=groesster wert p
1300 fori=1toba:n(i)=int(20*p(i)/g):next:rem masstab balken
1310 f=int(g/5)
1320 Ce muenzgrafik
1330 Cta$
1331 ifa$=chr$(134)thenC8
1332 Ce graphsave
1333 poke198,0:goto1330
1334 C:
1350 ifa$=chr$(133)thenC8
1352 Ce D%hardcopy
1353 Ce listendruck
1355 C:
1390 run
1391 Cg
1400 Cd torte
1402 Cy:print"'.dat'-[196]atei laden (j/n)";:Cs ft$,1,tx$
1403 iftx$="n"then1410
1404 print"[198]ilename (ohne '.dat'): ";:Cs ft$,12,fi$
1405 Ce loaddata
1406 ifba>6 then ba=6
1407 goto1431
1410 Cy:print"[215]ieviele [208]osten (max.6):";:Cs fc$,1,ba$:ba=val(ba$)
1420 ifba<1orba>6thenprint"unerlaubter [215]ert!":Dq2:goto1410
1430 Ce eingabe
1431 Ce eingabe2
1432 g$=str$(g)
1440 Ce grafiktorte
1450 Cta$
1451 ifa$=chr$(134)thenC8
1452 Ce graphsave
1453 poke198,0:goto1450
1454 C:
1470 ifa$=chr$(133)thenC8
1472 Ce D%hardcopy
1473 Ce listendruck
1475 C:
1510 run
1511 Cg
1520 Cd eingabe
1540 print:print"[212]itel fuer [199]rafik ";t$
1541 Cs ft$,12,t$
1550 print:print"[200]oechstwert (max.4stellig)":Cs fc$,4,p$
1555 iflen(p$)<4thenp$=p$+chr$(32):goto1555
1560 fori=1toba:o=o+1:printo".";
1570 print"[215]ert ";:Cs fc$,4,ee$(i):bb(i)=val(ee$(i)):print"[145]"spc(16);
1580 print"[194]ezeichnung:";:Cs ft$,10,z$(i)
1590 iflen(z$(i))<2thenz$(i)=chr$(32)+z$(i):goto1590
1595 bb$(i)=str$(bb(i))
1597 iflen(bb$(i))<10thenbb$(i)=chr$(32)+bb$(i):goto1597
1600 s=s+bb(i)
1605 su=su+abs(bb(i))
1610 p(i)=abs(bb(i)):nexti
1620 Ce speichern
1621 Cg
1622 Cd eingabe2
1623 print"[205]ittelwert zeigen (j/n) ";:Cs ft$,1,f$
1625 iff$="j"thenmw=int(s/ba):m$="[205]ittelw.:"+str$(mw)+" "+p$
1628 print"[211]umme in [199]rafik zeigen (j/n) ";:Cs ft$,1,g$
1630 ifg$="j"thens$="[211]umme:"+str$(s)+" "+p$
1631 print"% ausrechnen + [212]ab.[196]ruck.(j/n) ";:Cs ft$,1,f$
1632 fori=1toba
1633 j1=p(i)
1635 j1=int((j1*100/su)+.5):j$=str$(j1)
1636 iflen(j$)<3thenj$=chr$(32)+j$:goto1636
1637 j$(i)=j$
1638 nexti
1640 print"[203]ommentar zur [212]abelle (j/n)[160]";:Cs ft$,1,b$
1660 ifb$="j"thenprint"[203]ommentar:":Cs ft$,37,k$
1670 print
1680 print"[196]rucker [207][206][204][201][206][197] (j/n)";:Cs ft$,1,q$
1700 ifq$<>"j"then1680
1721 Cg
1740 Cd maxvwert
1750 g=0:t=20000:ss=1
1760 fori=1toba
1770 ifss=1theng=p(i):t=p(i):ss=2
1780 ifp(i)<tthent=p(i)
1790 ifp(i)>gtheng=p(i)
1800 nexti:rem g= groesster wert p
1810 fori=1toba:n(i)=int(120*p(i)/g):next
1820 rem masstab y-achse ausD.hnen
1830 f=int(g/10)
1840 Cg
1860 Cd diagramm
1870 D%0,3
1880 D847,1,""+t$,1,2,10,1
1890 D.x+13,h-140,(ba*21)+15,h-15,1
1900 D,x+13,h,x+11,h,1
1910 fori=12to120step12
1950 D,x+13,h-i,x+11,h-i,1
2000 nexti
2010 D80,h-3," 0",1,1,8,1
2020 fori=15to123step12:w=w+f:a$=str$(w)
2030 iflen(a$)<6thena$=chr$(32)+a$:goto 2030
2050 D80,h-i,""+a$,1,1,8,1
2090 nexti:D80,h-140,""+p$,1,1,8,1
2100 forq=x+19to(ba-1)*21+x+19step21
2110 j=j+1:x$=left$(z$(j),2)
2120 D8q,h+10,""+x$,1,1,8,1
2130 nextq
2140 fori=1toba
2150 x=x+21
2160 b=n(i):y=h-b:e=x+a:f=h1-b:g=x+c+a:k=x+c
2170 ifb=0then2240
2180 D. x,y,a,b,1
2190 D, x,y,k,f,1
2200 D, k,f,g,f,1
2210 D, g,f,e,y,1
2220 D, g,f,g,h1,1
2230 D, g,h1,e,h,1
2240 nexti
2250 i=0
2260 forx=72to(ba-1)*21+72step21
2270 i=i+1:b=n(i):ifb=0then2290
2280 ifsgn(bb(i))=-1thenD8x-11,h1-132,"-[146]",1,1,7,1:goto2290
2281 D3x,h1,1
2290 nextx
2300 D847,h+20,""+m$,1,1,10,1
2310 D847,h+30,""+s$,1,1,8,1
2340 Cg
2360 Cd paretodiagramm
2370 D%0,3:x=20
2380 D830,1,""+t$,1,2,10,1
2390 D.x+13,h-140,(ba*22)+15,h-15,1
2400 fori=12to120step12
2450 D,x+13,h-i,x+11,h-i,1
2500 nexti
2510 D80,h-3," 0",1,1,8,1
2520 fori=15to123step12:w=w+f:a$=str$(w)
2530 iflen(a$)<4thena$=chr$(32)+a$:goto2530
2550 D80,h-i,""+a$,1,1,8,1
2570 nexti:D80,h-140," %",1,1,8,1
2580 forq=x+23to(ba-1)*23+x+23step23
2590 j=j+1:x$=left$(z$(j),2)
2600 D8q,h+10,""+x$,1,1,8,1
2610 nextq:a=22
2620 fori=1toba
2630 x=x+22
2640 b=n(i):y=h-b:e=x+a:f=h1-b:g=x+c+a:k=x+c
2650 D.x,y,a,b,1
2660 h=y
2670 nexti
2680 h=160:a=12:i=o
2690 D830,h+20,""+s$,1,1,8,1
2700 D830,h+30,""+m$,1,1,8,1
2720 Cg
2740 Cd muenzgrafik
2750 D%0,3:y=130:a=0:c=0:x=0
2760 forx=80to((ba-1)*40)+80step40
2770 a=a+1:b=n(a):c=y-(3*b)
2780 D1x,c,15,8,1
2790 fori=1ton(a)
2800 D2x,c+(3*i),15,5,90,270,8,1
2810 nexti
2820 D8x-8,c-2,"dm",1,1,8,1
2825 ifsgn(bb(a))=-1thenD8x-6,c-17,"-[146]",1,1,8,1
2830 nextx
2840 D.60,50,(40*ba),100,1
2850 fori=3to63step12
2860 D,62,138-i,58,138-i,1
2870 nexti
2880 D80,132," 0",1,1,8,1
2890 D80,50," "+p$,1,1,8,1
2900 fori=1to5
2910 w=w+f:a$=str$(w)
2920 iflen(a$)<7thena$=chr$(32)+a$:goto2920
2950 D80,132-(i*12),""+a$,1,1,8,1
2970 nexti
2980 forq=75to(ba-1)*40+75step40
2990 j=j+1:x$=left$(z$(j),2)
3000 D8q,160,""+x$,1,1,8,1
3010 nextq
3020 D820,175,""+m$,1,1,8,1
3030 D820,185,""+s$,1,1,8,1
3060 D840,20,""+t$,1,2,10,1
3070 Cg
3090 Cd bldiagramm
3100 h=95:x=37
3110 data"[193]","[194]","[195]","[196]","[197]","[198]","[199]","[200]","[201]","[202]","[203]","[204]","[205]","[206]","[207]","[208]","[209]","[210]"
3111 data"[211]","[212]","[213]","[215]","[216]","[217]","[218]"
3120 ifba>18thena=8:c=3:o=0
3130 ifba>12andba<19thena=10:c=3:o=1
3140 ifba>6andba<13thena=16:c=3:o=4
3150 ifba<7thena=24:c=3:o=8
3160 D%0,3
3170 D855,0,""+t$,1,2,10,1
3180 fori=15to79step16
3200 D,x+5,i,x+3,i,1
3220 nexti
3230 ifx$=chr$(133)then3300
3240 fori=111to175step16
3260 D,x+5,i,x+3,i,1
3280 nexti
3290 goto3350
3300 fori=121to185step16
3320 D,x+5,i,x+3,i,1
3340 nexti
3350 ifx$=chr$(133)thenD,x+5,105,x+18+((a+c)*ba)+(2*o),105,1
3360 D,x+5,95,x+18+((a+c)*ba)+(2*o),95,1
3370 D8x-7,92,"+",1,1,7,1
3380 D8x-7,102,"-",1,1,7,1
3390 ifx$=chr$(137)thenD.x+5,15,((a+c)*ba)+13+(2*o),160,1:goto3410
3400 D.x+5,15,((a+c)*ba)+13+(2*o),170,1
3410 k=x+5:j=h:ifn(1)<1thenj=95
3420 fori=1toba
3430 x=x+a+c
3440 ifx$=chr$(137)thenreado$:D8x+o,180,""+o$,1,1,7,1
3450 ifx$=chr$(137)thengosub3720:goto3500
3460 reado$:D8x+o,97,""+o$,1,1,7,1
3470 b=n(i):ifsgn(b)=-1thenb=b*-1:goto3760
3480 y=h-b
3490 D.x,y,a,b,1
3500 nexti
3510 fori=76to12step-16:w=w+f:a$=str$(w)
3520 iflen(a$)<5thena$=chr$(32)+a$:goto3520
3550 D80,i,""+a$,1,1,8,1
3580 nexti:D80,3," "+p$,1,1,8,1
3585 D80,190,""+m$,1,1,8,1
3587 D8170,190,""+s$,1,1,8,1
3590 w=0
3600 ifx$=chr$(133)thengoto3620
3610 fori=108to172step16:w=w+f:a$=str$(w):goto3630
3620 fori=118to182step16:w=w+f:a$=str$(w)
3630 iflen(a$)<5thena$=chr$(32)+a$:goto3630
3650 D80,i,""+a$,1,1,8,1
3690 nexti
3700 Cg
3720 b=n(i):y=h-b:ifsgn(b)=-1thenletb=b*-1:y=95+b
3730 D,k+o+3,j,x+o+3,y,1:k=x:j=y
3740 return
3760 y=105
3770 D.x,y,a,b,1
3780 D3x+1,y+1,1
3790 goto3500
3800 Cd grafiktorte
3805 D%0,3
3810 D840,1,""+t$,1,2,10,1
3815 D80,17,"[205]ax.[215]ert:"+g$+" "+p$,1,1,8,1
3820 D1150,100,100,50,1
3830 D2150,120,100,50,90,270,5,1
3840 r=360/su:D,150,100,150,50,1
3850 D,50,100,50,120,1:D,250,100,250,120,1
3860 fori=1toba
3865 q(i)=abs(bb(i))
3870 p=p+q(i)
3880 m=(r*p/180)*(NULL):n=((r*q(i)/2)/180)*(NULL)
3881 Ce D2teilen
3885 D,150,100,mm,nn,1
3886 readx$:x=asc(x$)-128:x$=chr$(x)
3890 D8145-cos((m-n)+((NULL)/2))*130,100-sin((m-n)+((NULL)/2))*80,x$,1,1,7,1
3895 ifq(ba)=abs(bb(1))then3910
3900 ifq(i)=gandh<>gthenD3150-cos((m-n)+(NULL)/2)*20,100-sin((m-n)+(NULL)/2)*20,1
3905 h=q(i)
3910 nexti
3915 D80,190,""+m$,1,1,7,1
3917 D8170,190,""+s$,1,1,7,1
3920 Cg
3930 Cd D%hardcopy
3940 open1,4,16:print#1,chr$(27)chr$(108)chr$(7):close1:rem rand links
3950 open1,4,16
3960 open9,4,25,"7"
3970 print#1,chr$(27)" v"
3980 print#1,chr$(08)
3990 D
4000 close1:close9
4010 Cg
4020 Cd listendruck
4030 D(:Cy
4040 open1,4,7:cmd1
4050 print:print:print" [204]iste der [215]erte:"
4060 print:printk$
4070 print:print"[203]uerzel [215]ert [194]ezug % [208]osten":print
4080 i$="#########.##"
4090 fori=1toba:j$=j$(i)
4100 x$=left$(z$(i),2):iff$<>"j"then4115
4110 print" "x$" ";
4111 print C (i$,val(bb$(i)));
4112 print" "p$" ";j$" ";z$(i):goto4120
4115 print" "x$" ";
4116 print C (i$,val(bb$(i)));
4117 print" "p$;" ";z$(i)
4120 nexti
4130 print#1:close1
4150 Cg
4170 Cd azliste
4180 D(:Cy
4190 open1,4,7:cmd1
4200 print:print:print" [204]iste der [215]erte:"
4210 print:printk$
4220 print:print"[203]uerzel [215]ert [194]ezug % [208]osten":print
4230 restore:i$="#########.##"
4240 fori=1toba::j$=j$(i)
4250 readx$:iff$<>"j"then4265
4260 print" "x$" ";
4261 print C (i$,val(bb$(i)));
4262 print" "p$" ";j$" ";z$(i):goto4270
4265 print" "x$" ";
4266 print C (i$,val(bb$(i)));
4267 print" "p$;" ";z$(i)
4270 nexti
4280 print#1:close1
4300 Cg
4310 Cd D2teilen
4320 mm=(150-cos(m+(NULL)/2)*100):nn=(100-sin(m+(NULL)/2)*50)
4330 if(r*p)>90and(r*p)<270thenD,mm,nn,mm,nn+20,1
4340 Cg
4400 Cd sortierung
4420 i=1
4450 xx=i+1
4460 ifbb$(i)>bb$(xx)then4480
4462 Dj bb$(i),bb$(xx)
4472 Dj z$(i),z$(xx)
4478 Dj j$(i),j$(xx)
4480 xx=xx+1
4490 ifxx<=bathen4460
4500 i=i+1
4510 ifi<>bathen4450
4520 Cg
4600 Cd savedata
4610 open2,8,2,"@0:"+left$(t$,12)+".dat"+",s,w"
4615 print#2,t$
4620 print#2,str$(ba)
4630 print#2,p$
4640 fori=1toba
4642 print#2,str$(bb(i))
4644 print#2,z$(i)
4650 print#2,str$(p(i))
4660 next
4665 print#2,str$(s)
4670 print#2,str$(su)
4680 print#2:close2
4690 Cg
4700 Cd loaddata
4710 open2,8,2,left$(fi$,12)+".dat"+",s,r"
4715 input#2,t$
4720 input#2,ba$:ba=val(ba$)
4730 input#2,p$
4740 fori=1toba
4742 input#2,bb$(i):bb(i)=val(bb$(i))
4744 input#2,z$(i)
4750 input#2,p$(i):p(i)=val(p$(i))
4760 next
4765 input#2,s$:s=val(s$)
4770 input#2,su$:su=val(su$)
4780 close2
4790 Cg
4800 Cd speichern
4810 print"[197]ingaben als '.dat'-[198]ile speichern (j/n)";:Cs ft$,1,tx$
4820 if tx$="n" then 4840
4830 Ce savedata
4840 Cg
4900 Cd graphsave
4910 D(:Cy
4920 print"dateiname der grafik:"
4930 Cs ft$,16,gr$
4940 D&
4950 CQ(gr$)
4960 Cg