home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er Special 61
/
64er_Magazin_Sonderheft_61_19xx_Markt__Technik_de_Side_B.d64
/
kern.bas
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
6KB
|
242 lines
100 rem krieg der kerne
101 rem
102 rem nach spektrum der wissenschaft
103 rem 8/84
104 rem
105 rem martin rogge, moellenholt 24
106 rem 2300 kiel 1
107 rem 11.06.87
108 :
109 goto1000
110 :
150 a$=""
160 ll=5:goto200
170 ll=16
200 printa$;"[164][157]";
210 getb$:ifb$=""goto210
215 b=asc(b$):ifb>95orb=34goto210
220 ifb=13thenprint" ":return
230 ifb<>20goto260
240 iflen(a$)<1goto210
250 a$=left$(a$,len(a$)-1):print" [157][157][164][157]";:goto210
260 ifb<32goto210
270 iflen(a$)<llthena$=a$+b$:printb$"[164][157]";:goto210
280 a$=left$(a$,len(a$)-1)+b$:print"[157]"b$;:goto210
290 :
1000 data dat,mov,add,sub,jmp,jmz,jmn,djn,djz,cmp,spl
1200 poke53280,0:poke53281,0
1210 dim f$(1,255),l(1),n$(1),w(2),b(4)
1220 fori=0to10:readb$(i):next:l(0)=-1:l(1)=-1
1230 f(0)=28928:f(1)=30208:ba=7*4096:kf=31488
1240 :
1500 print"[158][147]"," "
1510 print," krieg der kerne "
1520 print," "
1530 print,"1 - editor"
1540 print,"2 - kaempfer laden"
1550 print,"3 - kaempfer speichern"
1560 print,"4 - kampf starten"
1562 print,"5 - speicher listen"
1565 print,"6 - ende"
1570 geta$:ifa$<"1"ora$>"6"goto1570
1580 onval(a$)goto8000,6000,7000,2000,9500
1590 :
1600 print"[147]":end
1610 :
2000 print"[147]kaempfer a: "n$(0)
2010 k=0:gosub3000:iffgoto2340
2100 print"kaempfer b: "n$(1)
2110 k=1:gosub3000:iffgoto2340
2120 print"wieviele zuege pro kampf ? ";:a$="10000":gosub160:z=val(a$)
2130 pokeba+13,z/256:pokeba+12,z-256*peek(ba+13)
2140 print"wieviele kaempfe ? ";:a$="1":gosub160:y=val(a$)
2150 pokeba+8,l(0):pokeba+9,l(1):d=999-l(0)-l(1)
2160 w(0)=0:w(1)=0:w(2)=0
2170 fori=1toy:sys26624
2175 forj=0to7:pokeba+j,0:next
2180 x=int(d*rnd(1))+l(0)+1:poke38913,x/256:poke38912,x-256*peek(38913)
2190 a=usr(0):w(a)=w(a)+1
2200 next
2205 poke53280,11:gosub5540:poke53280,0
2300 print"[147]ergebnis:"
2310 print""n$(0):print"[145]"spc(18)w(1)
2320 print""n$(1):print"[145]"spc(18)w(2)
2330 print"unentschieden "w(0)
2340 print"":gosub5530:goto1500
2350 :
3000 ifl(k)<0thenprint"compilation error: kein quellcode.":f=-1:return
3005 f=0:fori=0tol(k)
3010 a$=f$(k,i):gosub4000:iflen(a$)<4goto3900
3030 b$=left$(a$,3)
3040 forj=0to10:ifb$=b$(j)thenx=j:j=12
3050 next:ifj<12thenf=-1:goto3900
3060 a$=mid$(a$,4):gosub4000
3070 onxgoto3400,3400,3400,3500,3600,3600,3800,3800,4200,3500
3080 gosub4700:iffgoto3900
3090 zq%=vo*za:zz%=0:aq=0:az=0
3100 b(0)=xor48ork*64or((x>0)and128)
3110 b(1)=zq%-256*int(zq%/256)
3120 b(2)=((zq%/256)and15)oraq*64
3130 b(3)=zz%-256*int(zz%/256)
3140 b(4)=((zz%/256)and15)oraz*64
3150 forj=0to4:pokef(k)+256*j+i,b(j):next
3160 next:print"compilation complete, no error.":return
3170 :
3400 gosub4600:iffgoto3900
3405 aq=aa:zq%=vo*za
3410 gosub4800:iffgoto3900
3415 az=aa:zz%=vo*za:goto3100
3420 :
3500 gosub4800:iffgoto3900
3505 zq%=vo*za:zz%=0:aq=aa:az=0:goto3100
3510 :
3600 gosub4800:iffgoto3900
3605 aq=aa:zq%=vo*za
3610 gosub4600:iffgoto3900
3615 az=aa:zz%=vo*za:goto3100
3620 :
3800 gosub4800:iffgoto3900
3805 aq=aa:zq%=vo*za
3810 gosub4800:iffgoto3900
3815 az=aa:zz%=vo*za:goto3100
3820 :
3900 x=i:i=l(k):next:print"compilation error in line"x:f=-1:return
3910 :
4000 ifleft$(a$,1)=" "thena$=mid$(a$,2):goto4000
4010 return
4020 :
4200 gosub4600:iffgoto3900
4205 aq=aa:zq%=vo*za
4210 gosub4600:iffgoto3900
4215 az=aa:zz%=vo*za:goto3100
4220 :
4500 b$=left$(a$,1):a$=mid$(a$,2)
4505 ifb$=" "orb$=""thenm=-2:return
4530 ifb$<"0"orb$>"9"thenm=-1:return
4540 m=val(b$):return
4550 :
4600 aa=1:b$=left$(a$,1):ifb$="#"thenaa=0:a$=mid$(a$,2)
4610 ifb$="@"thenaa=2:a$=mid$(a$,2)
4620 :
4700 vo=1:b$=left$(a$,1):ifb$="-"thenvo=-1
4710 ifb$="+"orb$="-"thena$=mid$(a$,2)
4720 gosub4500:ifm<0orm>9thenf=-1:return
4730 za=m
4740 gosub4500:ifm=-2goto4770
4750 ifm<0orm>9thenf=-1:return
4760 za=10*za+m:goto4740
4770 ifza>999thenf=-1
4780 return
4790 :
4800 gosub4600:ifaa=0thenf=-1
4810 return
4820 :
5000 print"[147]kaempfer a oder b ? ";
5010 geta$:ifa$="a"thenk=0:goto5040
5020 ifa$<>"b"goto5010
5030 k=1
5040 printa$:return
5050 :
5500 f=0:input#1,v$,w$,x$,y$:ifval(v$)<9thenreturn
5510 print"disk-error:":f=-1
5520 printv$":"w$":"x$":"y$
5530 print"<cr> druecken"
5540 geta$:ifa$<>chr$(13)goto5540
5550 return
5560 :
6000 gosub5000 :rem laden
6010 print"name: ";:a$="":gosub170:n$(k)=a$
6020 open1,8,15:print#1,"i0":gosub5500:iffgoto6900
6030 open2,8,2,n$(k):gosub5500:iffgoto6900
6040 l(k)=-1
6050 l(k)=l(k)+1:input#2,f$(k,l(k)):ifst=0goto6050
6060 gosub5500
6900 close2:close1:goto1500
6910 :
7000 gosub5000 :rem speichern
7020 open1,8,15:print#1,"i0":gosub5500:iffgoto6900
7025 print"name: ";:a$=n$(k):gosub170:n$(k)=a$
7030 open2,8,2,n$(k)+",s,w":gosub5500:iffgoto6900
7035 print""n$(k)" wird gespeichert."
7040 fori=0tol(k)
7050 print#2,chr$(34)f$(k,i):next
7060 goto6060
7070 :
8000 gosub5000:ez=0
8100 print"[147]name: "n$(k):print
8110 fori=eztoez+9:ifi>l(k)thenf$(k,i)=""
8120 print""right$(" "+str$(i),4)" [146] "f$(k,i)
8130 next
8140 print"s[146]chreiben"
8150 print"l[146]oeschen"
8160 print"a[146]endern"
8170 print"d[146]rucken"
8180 print"u[146]mbenennen"
8190 print"+/-"
8200 print"e[146]nde"
8210 geta$:fori=1to8:ifa$=mid$("+-esladu",i,1)thena=i:i=9
8220 next:ifi<10goto8210
8230 onagoto8300,8400,1500,8600,8800,9000,9200,9400
8240 :
8300 ifez<231thenez=ez+10:goto8100
8310 goto8210
8320 :
8400 ifez>9thenez=ez-10:goto8100
8410 goto8210
8420 :
8600 print"schreiben ab zeile: ";:gosub150:aa=val(a$)
8610 ifaa<0oraa>l(k)+1goto8100
8620 print"[147]abbruch durch eine leerzeile.":ll=30
8630 ifl(k)>248goto8100
8635 print""right$(" "+str$(aa),4)" [146] ";
8640 a$="":gosub200:ifa$=""goto8100
8650 ifaa>l(k)thenf$(k,aa)=a$:aa=aa+1:l(k)=l(k)+1:goto8630
8660 fori=l(k)toaastep-1:f$(k,i+1)=f$(k,i):next:l(k)=l(k)+1
8670 f$(k,aa)=a$:aa=aa+1:goto8630
8680 :
8800 print"loeschen von zeile: ";:gosub150:aa=val(a$)
8810 print" bis zeile: ";:gosub150:bb=val(a$)
8820 ifbb<aaoraa<0oraa>l(k)goto8100
8830 ifbb=>l(k)thenl(k)=aa-1:goto8100
8840 d=bb+1-aa:fori=bb+1tol(k):f$(k,i-d)=f$(k,i):next
8850 l(k)=l(k)-d:goto8100
8860 :
9000 print"aendern von zeile: ";:gosub150:aa=val(a$)
9010 ifaa<ezoraa>ez+9oraa>l(k)goto8100
9020 print""
9030 fori=0toaa-ez:print:next
9040 print"";:a$=f$(k,aa):ll=30
9050 gosub200:f$(k,aa)=a$:goto8100
9060 :
9200 print"[147]":open4,4,0
9205 print#4,"name: "n$(k):print#4
9210 fori=0tol(k)
9220 print#4,right$(" "+str$(i),4)" "f$(k,i)
9230 next
9240 close4:goto8100
9250 :
9400 print"name: ";:a$=n$(k):gosub170:n$(k)=a$:goto8100
9410 :
9500 print"[147]abbruch durch _"
9510 fori=0to999:print""right$(" "+str$(i),4)" [146] ";
9515 za=peek(kf+5*i)
9520 ifza=0goto9800
9525 print"";:if(zaand64)thenprint"";
9530 za=zaand15:printb$(za)" ";
9537 aq=int(peek(kf+5*i+2)/64):q=256*(peek(kf+5*i+2)and15)+peek(kf+5*i+1)
9538 ifq>2047thenq=q-4096
9539 a$="":ifza=0goto9555
9540 ifaq=0thena$="#"
9550 ifaq=2thena$="@"
9555 l=2:ifq<0thenl=1
9560 printa$mid$(str$(q),l)" ";
9570 ifza=0orza=4orza=10goto9800
9575 az=int(peek(kf+5*i+4)/64):z=256*(peek(kf+5*i+4)and15)+peek(kf+5*i+3)
9577 ifz>2047thenz=z-4096
9580 a$="":ifaz=0thena$="#"
9590 ifaz=2thena$="@"
9595 l=2:ifz<0thenl=1
9600 printa$mid$(str$(z),l)" ";
9800 print"[158]":geta$:ifa$="_"theni=999
9810 next:gosub5530:goto1500