home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disc 9
/
Commodore_Disc_09_19xx_-_de.d64
/
bundesliga.64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
10KB
|
383 lines
10 rem ----------------------
20 rem - -
30 rem - bundesliga -
40 rem - -
50 rem - by ralf trabhardt -
60 rem - -
70 rem ----------------------
80 rem - c64/128 +1541 +joy -
90 rem - (c) commodore welt -
100 rem ----------------------
110 ifa=0thena=1:load"titel",8,1
120 sys20480
130 dimna$(20),sp(20),gw(20),un(20),ve(20),t1(20),t2(20),di(20),p1(20),p2(20)
140 dimv(21)
150 rem
160 rem steuer-/farbcodes
170 rem
180 c1$=chr$(147):c2$=chr$(19)
190 c3$=chr$(18):c4$=chr$(146)
200 c5$=chr$(157):c6$=chr$(145)
210 c7$=chr$(17):f1$=chr$(144)
220 f2$=chr$(30):f3$=chr$(5)
230 f4$=chr$(150):f5$=chr$(158)
240 f6$=chr$(31):f7$=chr$(28)
250 f8$=chr$(159):f9$=chr$(151)
260 rem
270 b1$="1.bundesliga":b2$="2.bundesliga"
280 fb=53280:fa=54272:pokefb,13:pokefb+1,13:m=49664
290 printc1$f1$:u=0
300 printc2$
310 ifu=1thenprinttab(254);b1$:goto330
320 printtab(254)c3$;b1$
330 printtab(218)"oder"
340 ifu=1thenprinttab(214)c3$;b2$:goto360
350 printtab(214)b2$
360 gosub3380
370 ifsc=2thenu=0
380 ifsc=3thenu=1
390 ifsc=1andu=0thenli=18:goto420
400 ifsc=1andu=1thenli=20:goto420
410 goto300
420 gosub740:printc1$f1$:u=0
430 printc2$
440 ifu=1thenprinttab(254)"alte saison":goto460
450 printtab(254)c3$"alte saison"c4$
460 printtab(217)"oder"
470 ifu=1thenprinttab(214)c3$"saisonstart"c4$:goto490
480 printtab(214)"saisonstart"
490 gosub3380
500 ifsc=2thenu=0
510 ifsc=3thenu=1
520 ifsc=1andu=0thengosub740:goto870
530 ifsc=1andu=1thengosub740:goto580
540 goto430
550 rem
560 rem namen eingeben
570 rem
580 fori=1toli:na$(i)="":p1(i)=0:t1(i)=0:t2(i)=0:gw(i)=0:un(i)=0:ve(i)=0
590 sp(i)=0:nexti:q=1:poke198,0
600 pokefb,0:pokefb+1,0:printc1$f2$"[195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195]"
610 printtab(95);f3$;q;c5$".verein"
620 printtab(93);f4$"---------------"
630 printf2$"[195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195]"
640 printc6$c6$c6$c6$;tab(11);f5$;
650 inputa$:printc7$
660 iflen(a$)>15then610
670 na$(q)=a$:a$="":poke781,8:sys59903
680 ifq=lithen1000
690 q=q+1:goto610
700 rem
710 rem feuertaste
720 rem
730 wait56320,16,16
740 sd=54273:pokesd+4,11:pokesd+14,5:pokesd+23,15
750 pokesd,20
760 pokesd+3,21
770 forgh=1to300:nextgh
780 pokesd+3,0
790 return
800 x1=x(1):x2=x(2)
810 wt=(x1-176)+((x2-176)*10)
820 pokepo+fa,13:pokepo+fa-1,13:return
830 wl=(x(2)-176)*100+(x(1)-176)*10+(x(0)-176)
840 pokepo+fa,13:pokepo+fa-1,13:pokepo+fa-2,13:return
850 rem
860 rem werte einlesen
870 rem
880 printc1$;tab(164);f1$"- daten-diskette einlegen -"
890 gosub710
900 printc1$;tab(164)"daten werden eingelesen ..."
910 ifli=18thenopen1,8,2,"1.bundesliga,s,r"
920 ifli=20thenopen1,8,2,"2.bundesliga,s,r"
930 fori=1toli
940 input#1,na$(i),gw(i),un(i),ve(i),t1(i),t2(i)
950 nexti
960 close1:close15
970 rem
980 rem ergebnisse eingeben
990 rem
1000 pokefb,5:pokefb+1,13
1010 printc1$;tab(240);tab(162);f1$"wieviele begegnungen eintragen ?"
1020 po=1460:i=176:pokefa+po,2:pokefa+po-1,2
1030 gosub3380
1040 ifsc=1thenbe=i-176:ifi=186thenbe=10
1050 ifsc=1thengosub740:goto1140
1060 ifsc=2theni=i+1
1070 ifsc=3theni=i-1:ifi<176theni=176
1080 ifli=18andi>185theni=185:goto1110
1090 ifi=>186theni=186:pokepo-1,177:pokepo,176:goto1120
1100 ifi=185thenpokepo-1,32
1110 pokepo,i
1120 forj=1to100:nextj
1130 goto1030
1140 ifbe=0then2400
1150 pokefb,11:pokefb+1,12:la=1616
1160 printc1$f1$"[195][195][195][195][195][195][195][195][195][195][195][179]"f3$"spielpaarungen"f1$"[171][195][195][195][195][195][195][195][195][195][195][195][195][195]";
1170 printf1$" [173][195][195][195][195][195][195][195][178][195][195][195][195][195][195][189]"
1180 fori=1toli step2
1190 printtab(2);f9$;na$(i)
1200 printtab(19);c6$f1$"[194] ";f9$;na$(i+1):nexti
1210 printf1$"[184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184]"
1220 ifli=18thenprint
1230 ad=1105:c1=0:c2=0:xz=0:poke646,0
1240 pokela,61:pokela+4,58:pokefa+la,0:pokefa+la+4,0
1250 gosub3380
1260 ifsc=1thengosub740:goto1350
1270 ifsc=4thenc2=0
1280 ifsc=2thenc1=c1-1:ifc1<0thenc1=0
1290 ifsc=5thenc2=1
1300 ifsc=3thenc1=c1+1:ifc1>li/2-1thenc1=li/2-1
1310 pokepo,32
1320 po=ad+(c1*40)+(c2*20)
1330 pokepo,62:pokefa+po,15
1340 goto1250
1350 pf=(po-(ad-20))/20
1360 ifxz=1thenxz=2:n2$=na$(pf):printn2$:goto1390
1370 ifxz=0thenxz=1:n1$=na$(pf):printn1$;f1$" - ";:fori=1to50:nexti
1380 goto1240
1390 lk=la:la=la+40
1400 x1=176:x2=x1
1410 pokelk+2,x2:pokelk+3,x1
1420 fori=1to100:nexti
1430 gosub3380
1440 ifsc=1andxz=3thenxz=0:gosub740:gosub810:e2=wt:goto1510
1450 ifsc=1andxz=2thenxz=3:gosub740:gosub810:e1=wt:lk=lk+3:goto1400
1460 ifsc=2thenx1=x1+1:ifx2=176andx1>185thenx1=176:x2=177
1470 ifsc=3thenx1=x1-1:ifx2=176andx1<176thenx1=176
1480 ifx2=177andx1<176thenx2=176:x1=185
1490 ifx2=177andx1>185thenx1=185
1500 goto1410
1510 q=0:d=0
1520 fori=1to18
1530 ifn1$=na$(i)thend=i
1540 ifn2$=na$(i)thenq=i
1550 nexti
1560 gosub3140
1570 be=be-1:ifbe=0then1600
1580 fori=1to50:nexti
1590 goto1240
1600 forle=2to12:poke781,le:sys59903:nextle
1610 gosub1670:fe=0:print" ja "
1620 gosub3380:ifsc=2thengosub1670:print" ja ":fe=0
1630 ifsc=3thengosub1670:print" nein":fe=1
1640 ifsc=1andfe=0then3040
1650 ifsc=1andfe=1then910
1660 goto1620
1670 printc2$;tab(126);f7$"alle eingaben korrekt ? ";:return
1680 rem
1690 rem tabelle ergaenzen
1700 rem
1710 pokefb,6:pokefb+1,14:v$=f6$+" "
1720 x1=176:x2=x1:po=1420:fori=1to80:nexti
1730 pokepo+fa,3:pokepo+fa-1,3
1740 printc1$;tab(240);tab(122);f5$"wieviele mannschaften aendern ?"
1750 pokepo,x1:pokepo-1,x2
1760 gosub3380
1770 ifsc=1thengosub740:gosub810:az=wt:goto1850
1780 ifx2=177andx1=184andli=18then1810
1790 ifx2=178andx1=176then1810
1800 ifsc=2thenx1=x1+1:ifx1>185thenx1=176:x2=x2+1
1810 ifsc=3andx2=176andx1>176thenx1=x1-1
1820 ifsc=3andx2>176thenx1=x1-1:ifx1<176thenx2=x2-1:x1=185
1830 fori=1to50:nexti
1840 goto1750
1850 ifaz=0then2400
1860 pokefb,6:pokefb+1,14
1870 printc1$;tab(13);f3$"[213][195][195][195][195][195][195][195][195][195][195][195][195][201]"
1880 print"[195][195][195][195][195][195][195][195][195][195][195][195][195][179]"f1$" mannschaft "f3$"[171][195][195][195][195][195][195][195][195][195][195][195][195][195]"
1890 printtab(13);c6$"[202][195][195][195][195][195][195][195][195][195][195][195][195][203]"
1900 fori=1toli:printv$;:printna$(i):nexti
1910 po=1157
1920 pokepo,62:pokepo+fa,7
1930 gosub3380
1940 ifsc=1thenma$=na$((po-1117)/40):goto1980
1950 ifsc=3andpeek(po+41)<>32thenpokepo,32:po=po+40
1960 ifsc=2andpo>1157thenpokepo,32:po=po-40
1970 goto1920
1980 pokefb,6:pokefb+1,6
1990 printc1$f8$;c7$"[195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195]"
2000 printchr$(156);tab(14);ma$
2010 printc7$;f8$"[195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195]"
2020 po=1415:cw=0:q=0
2030 fori=1toli:ifna$(i)=ma$thenq=i
2040 nexti
2050 x(1)=176:x(2)=176:l=1:fori=1to50:nexti
2060 pokepo+fa,3:pokepo+fa-1,13
2070 ifcw=0thenprinttab(87);f5$"gewonnene spiele"
2080 ifcw=1thenprinttab(47);f5$"unentschiedene spiele"
2090 ifcw=2thenprinttab(47);f5$"verlorene spiele"
2100 pokepo,x(1):pokepo-1,x(2)
2110 gosub3380
2120 ifsc=1andcw=2thencw=3:gosub740:gosub800:ve(q)=wt:goto2230
2130 ifsc=1andcw=1thencw=2:gosub740:gosub800:un(q)=wt:po=po+80:goto2050
2140 ifsc=1andcw=0thencw=1:gosub740:gosub800:gw(q)=wt:po=po+80:goto2050
2150 ifsc=4thenpokepo+fa,13:pokepo+fa-1,3:l=2
2160 ifsc=5thenpokepo+fa,3:pokepo+fa-1,13:l=1
2170 ifx(2)=179andx(1)=180andli=18then2200
2180 ifx(2)=179andx(1)=184then2200
2190 ifsc=2thenx(l)=x(l)+1:ifx(l)>185thenx(l)=176
2200 ifsc=3thenx(l)=x(l)-1:ifx(l)<176thenx(l)=185
2210 fori=1to50:nexti
2220 goto2100
2230 x(0)=176:x(1)=176:x(2)=176:po=po+120
2240 pokepo,x(0):pokepo-1,x(1):pokepo-2,x(2):gosub840:pokepo+fa,3:l=0
2250 ifcw=3thenprinttab(87);f5$"geschossene tore"
2260 ifcw=4thenprinttab(87);f5$"gefangene tore"
2270 pokepo,x(0):pokepo-1,x(1):pokepo-2,x(2)
2280 gosub3380
2290 ifsc=1andcw=4thengosub740:gosub830:t2(q)=wl:goto2370
2300 ifsc=1andcw=3thengosub740:gosub830:t1(q)=wl:cw=4:goto2230
2310 ifsc=4andl<2thengosub840:l=l+1:pokepo+fa-l,3
2320 ifsc=5andl>0thengosub840:l=l-1:pokepo+fa-l,3
2330 ifsc=2thenx(l)=x(l)+1:ifx(l)>185thenx(l)=176
2340 ifsc=3thenx(l)=x(l)-1:ifx(l)<176thenx(l)=185
2350 fori=1to50:nexti
2360 goto2270
2370 az=az-1:ifaz=0then3040
2380 goto1860
2390 rem
2400 rem tabelle ausgeben
2410 rem
2420 pokefb+1,13:pokefb,13
2430 fori=1toli
2440 p1(i)=gw(i)*2+un(i)
2450 sp(i)=gw(i)+un(i)+ve(i)
2460 p2(i)=ve(i)*2+un(i)
2470 di(i)=t1(i)-t2(i)
2480 nexti
2490 printc1$f1$;tab(126)"tabelle wird geordnet ..."
2500 gosub3230
2510 ifli=18thenprintc1$"************ t a b e l l e *************";
2520 print"[213][192][192][192][192][178][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][201]";
2530 print"[221]nr. [221] mannschaft [221] diff.[221] punkte [221]";
2540 print"[171][192][192][192][192][177][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][179]";
2550 fori=1toli:gosub2960
2560 nexti
2570 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]";
2580 gosub710
2590 goto3470
2600 rem
2610 rem drucker
2620 rem
2630 fori=1to3:forj=1to21:d$(i)=d$(i)+chr$(peek(49262+j+(21*i))):nextj:nexti
2640 open3,4:ifli=20then2720
2650 print#3,chr$(8),d$(1);
2660 print#3,chr$(15)" "c3$" "c4$" "chr$(8),d$(1)
2670 print#3,chr$(16),d$(2);
2680 print#3,chr$(15)" "c3$" b u n d e s l i g a "c4$" "chr$(8),d$(2)
2690 print#3,chr$(16),d$(3);
2700 print#3,chr$(15)" "c3$" "c4$" "chr$(8),d$(3)
2710 print#3
2720 print#3,chr$(15)"[213][192][192][192][192][178][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178]";
2730 print#3,"[192][192][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][192][201]"chr$(8)
2740 print#3,chr$(15)"[221] nr.[221]mannschaft [221] sp.[221] g. [221] u. [221] v. [221] tore [221]";
2750 print#3,"diff.[221] punkte [221]"chr$(8)
2760 print#3,chr$(15)"[171][192][192][192][192][219][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219]";
2770 print#3,"[192][192][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][192][179]"chr$(8):za=0
2780 za=za+1:y=v(za)
2790 print#3,chr$(15)"[221]";
2800 print#3,chr$(16)"01"za;
2810 print#3,chr$(16)"05[221]"na$(y);
2820 print#3,chr$(16)"21[221]"sp(y);
2830 print#3,chr$(16)"26[221]"gw(y);
2840 print#3,chr$(16)"31[221]"un(y);
2850 print#3,chr$(16)"36[221]"ve(y);
2860 print#3,chr$(16)"41[221] "t1(y);
2870 print#3,chr$(16)"46:"t2(y);
2880 print#3,chr$(16)"53[221] "di(y);
2890 print#3,chr$(16)"59[221] "p1(y);
2900 print#3,":"p2(y);
2910 print#3,chr$(16)"70[221]"chr$(8)
2920 ifza=lithen3200
2930 print#3,chr$(15)"[171][192][192][192][192][219][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219]";
2940 print#3,"[192][192][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][192][179]"chr$(8)
2950 goto2780
2960 print"[221]"i
2970 printtab(7);c6$;na$(v(i))
2980 printtab(24);c6$;di(v(i))
2990 printtab(30);c6$;p1(v(i))
3000 printtab(34);c6$":"p2(v(i))
3010 printtab(39);c6$"[221]";
3020 return
3030 rem
3040 rem abspeichern
3050 rem
3060 ifli=18thenopen1,8,2,"@:1.bundesliga,s,w"
3070 ifli=20thenopen1,8,2,"@:2.bundesliga,s,w"
3080 printc1$;tab(4)"liga-daten werden gesichert"
3090 fori=1toli
3100 print#1,na$(i)","gw(i)","un(i)","ve(i)","t1(i)","t2(i)
3110 nexti
3120 close1
3130 goto2420
3140 ife1>e2thengw(d)=gw(d)+1:ve(q)=ve(q)+1
3150 ife1=e2thenun(d)=un(d)+1:un(q)=un(q)+1
3160 ife2>e1thengw(q)=gw(q)+1:ve(d)=ve(d)+1
3170 t1(d)=t1(d)+e1:t2(d)=t2(d)+e2
3180 t1(q)=t1(q)+e2:t2(q)=t2(q)+e1
3190 return
3200 print#3,chr$(15)"[173][192][192][192][192][177][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][177][192][192][192][192][177][192][192][192][192][177][192][192][192][192][177][192][192][192][192][177]";
3210 print#3,"[192][192][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][192][189]"chr$(8)
3220 close3:goto3470
3230 pokem,0:pokem+1,li:pokem+4,li+1
3240 fori=1toli
3250 pokem+88+i,di(i)+100
3260 pokem+26+i,t1(i)
3270 pokem+5+i,p1(i)+1
3280 pokem+47+i,0
3290 nexti
3300 sys49152
3310 fori=1toli
3320 v(i)=peek(m+67+i)
3330 nexti
3340 return
3350 rem
3360 rem joystick
3370 rem
3380 sc=0
3390 j=peek(56320)
3400 if(jand16)=0thensc=1
3410 if(jand1)=0thensc=2
3420 if(jand2)=0thensc=3
3430 if(jand4)=0thensc=4
3440 if(jand8)=0thensc=5
3450 return
3460 rem
3470 rem auswahl-menue
3480 rem
3490 pokefb,11:pokefb+1,12
3500 printc1$f1$;tab(133)"[213][195][195][195][195][195][195][195][195][195][195][195][201]"
3510 printtab(13)"[194] "f3$"m e n u e"f1$" [194]"
3520 printtab(13)"[202][195][195][195][195][195][195][195][195][195][195][195][203]"
3530 f0$=chr$(155)+c3$+" "+c4$+" "+f9$
3540 printtab(208)f0$"tabelle auf drucker"
3550 printtab(48)f0$"statistik"
3560 printtab(48)f0$"tabelle ergaenzen"
3570 printtab(48)f0$"neuer spieltag"
3580 printtab(48)f0$"ende"
3590 po=1470:i=62:cu=1
3600 pokepo,i:pokefa+po,0
3610 gosub3380
3620 ifsc=1thengosub740:goto3660
3630 ifsc=2andcu>1thenpokepo,32:po=po-80:cu=cu-1
3640 ifsc=3andcu<5thenpokepo,32:po=po+80:cu=cu+1
3650 goto3600
3660 oncugoto2630,3680,1680,980,280
3670 rem
3680 rem statistik
3690 rem
3700 pokefb,5:pokefb+1,7
3710 printc1$f1$;tab(134)"statistik"
3720 printtab(14)"---------":si=0:te=0
3730 fori=1toli:te=te+t1(i)
3740 si=si+sp(i):nexti
3750 te$=left$(str$(te/si),5)
3760 printtab(162)"es sind bisher"si"spiele ausgetragen"
3770 printtab(42)"worden."
3780 printtab(82)"dabei sind"te"tore gefallen."
3790 printtab(82)"das entspricht einem durchschnitt von"
3800 printtab(41)te$" toren pro spiel."
3810 gosub710
3820 goto3470