home *** CD-ROM | disk | FTP | other *** search
- 10 poke53281,11:poke53280,15:poke646,13
- 100 input"[147]anleitung ? j[157][157][157]";z$:ifleft$(z$,1)<>"j"goto200
- 110 print"[147]jeder von uns hat 5 schiffe, die"
- 120 print"der jeweils andere nicht sehen kann."
- 130 print"wir schiessen abwechselnd auf eine"
- 140 print"koordinate. - daneben= '[215]', treffer= ' [146]'"
- 150 print"du musst versuchen, meine schiffe zu"
- 160 print"versenken, bevor ich deine versenke."
- 170 print"zuerst musst du die lage eingeben, z.b. 'laenge 3' mit 'e4-e6'."
- 180 print"viel glueck! taste druecken !!"
- 190 getz$:ifz$=""goto190
- 200 dim b(9,9,1),n$(4),l(4),h(4,1):r=ti
- 210 print"[147]battleships j. butterfield "
- 230 data carrier,battleship,cruiser,submarine,"pt boat"
- 240 data 5,5,4,3,2
- 250 for j=0 to 4:read n$(j):next j:forj=0to4:readl(j):nextj
- 260 r=r/1000:r1=rnd(-r):ifr>1goto260
- 280 print " my board your board"
- 290 z=0:z$="[176][178][178][178][178][178][178][178][178][174]":gosub 1100
- 300 z$="[171][219][219][219][219][219][219][219][219][179]":forz=1to8:gosub1100:next z
- 310 z$="[173][177][177][177][177][177][177][177][177][189]":gosub 1100
- 320 z$=""
- 330 e$=z$+" [145]"
- 340 print"^^^^^^^^^^":print"abcdefghij"
- 350 printz$;"input your ships (i won't peek)..."
- 360 forj=1to1000:nextj:printe$;"give end co-ordinates for each ship..."
- 370 forl=0to1:forj=0to9:fork=0to9:b(j,k,l)=0:nextk,j,l
- 380 forl=0to1:forj=0to4:h(j,l)=0:nextj,l
- 390 forc=0to4
- 400 printe$;n$(c);" (laenge";l(c);")";:inputy$:gosub1110:ife=1goto400
- 410 x1=x:y1=y:gosub1120:ife=1goto400
- 420 l=l(c):ifx<>x1andabs(x-x1)<>l-1goto400
- 430 ify<>y1andabs(y-y1)<>l-1goto400
- 440 ify=y1andx=x1goto400
- 450 y2=sgn(y1-y):x2=sgn(x1-x):y3=y:x3=x
- 460 forj=1tol-1:ifb(x3,y3,0)<>0goto400
- 470 ifx2*y2<>0thenifb(x3+x2,y3,0)=b(x3,y3+y2,0)thenifb(x3,y3+y2,0)<>0goto400
- 480 x3=x3+x2:y3=y3+y2:nextj
- 490 ifb(x3,y3,0)<>0goto400
- 500 y$="[209]":forj=1tol:b(x,y,0)=c+1:gosub1160:x=x+x2:y=y+y2:nextj,c
- 510 printe$;"now i am ready..":s=0:h9=0
- 520 forc=0to4:l=l(c)
- 530 d=int(rnd(1)*4):x1=l-1:y1=l-1
- 540 ifd=2thenx1=0
- 550 ifd=0theny1=0
- 560 x=int(rnd(1)*(10-x1)):ifd=3thenx=x+x1
- 570 y=int(rnd(1)*(10-y1)):y3=y:x3=x:x2=sgn(2-d):y2=sgn(y1)
- 580 forj=1tol-1:ifb(x3,y3,1)<>0goto530
- 590 ifx2*y2<>0thenifb(x3+x2,y3,1)=b(x3,y3+y2,1)thenifb(x3,y3+y2,1)<>0goto530
- 600 x3=x3+x2:y3=y3+y2:nextj
- 610 ifb(x3,y3,1)<>0goto530
- 620 forj=1tol:b(x,y,1)=c+1:x=x+x2:y=y+y2:nextj,c
- 630 printe$;
- 640 input": your shot";y$
- 650 gosub 1110:ife=1goto630
- 660 b=b(x,y,1):ifb>9goto630
- 670 b(x,y,1)=b+10:y$="[215]":ifb=0goto710
- 680 y$=" ":h(b-1,1)=h(b-1,1)+1:ifh(b-1,1)<l(b-1)goto710
- 690 printe$;n$(b-1);" sunk":forc=1to2000:nextc:forc=0to4:ifh(c,1)<l(c)goto710
- 700 nextc:goto1210
- 710 gosub1170
- 720 onsgoto780,860
- 730 x=int(rnd(1)*10):y=int(rnd(1)*10)
- 740 b=b(x,y,0):ifb<9goto 920
- 750 x=x+3:ifx<10goto740
- 760 x=x-10:y=y+1:ify<10goto740
- 770 y=y-10:goto740
- 780 x1=x9-d:x2=x9+d:y1=y9-d:y2=y9+d
- 790 ifx1<0thenx1=0
- 800 ify1<0theny1=0
- 810 ifx2>9thenx2=9
- 820 ify2>9theny2=9
- 830 forx=x1tox2:fory=y1toy2
- 840 b=b(x,y,0):ifb<9goto 920
- 850 nexty,x:d=d+1:goto780
- 860 x=x9:y=y9
- 870 x=x+x8:y=y+y8:ifx<0orx>9ory<0ory>9goto900
- 880 b=b(x,y,0):ifb<9goto 920
- 890 b=b-10:ifb>0goto870
- 900 ifs1=1thens=1:goto780
- 910 s1=1:x8=-x8:y8=-y8:goto860
- 920 b(x,y,0)=b+10:y$="[215]":h7=0:h8=sgn(b):h9=h9+h8:x$="miss":ifb=0goto 950
- 930 b=b-1:y$=" ":x$="hit":h(b,0)=h(b,0)+1:ifh(b,0)<l(b)goto 950
- 940 h7=1:h9=h9-l(b):x$="sink "+n$(b)
- 950 gosub1160:printe$;"i ";x$;" at ";chr$(x+65);chr$(y+48);:forj=1to1000:nextj
- 960 forj=0to4:ifh(j,0)<l(j)goto 980
- 970 nextj:goto1220
- 980 onsgoto1010,1060
- 990 ifh8=1thens=1:d=1:x9=x:y9=y
- 1000 goto640
- 1010 ifh9=0thens=0:goto640
- 1020 ifh8=0goto640
- 1030 x8=x-x9:y8=y-y9:s1=0
- 1040 ifx8=sgn(x8)andy8=sgn(y8)thens=2
- 1050 goto640
- 1060 ifh7=0goto640
- 1070 s=1
- 1080 ifh9=0thens=0
- 1090 goto640
- 1100 printz$;"_";chr$(z+48);" ";z$:return
- 1110 p=1:e=0
- 1120 for z=ptolen(y$)-1:x=asc(mid$(y$,z))-65:ifx>=0andx<=9goto1140
- 1130 nextz:e=1:return
- 1140 for p=ztolen(y$):y=asc(mid$(y$,p))-48:ify>=0andy<=9thenreturn
- 1150 nextp:goto1130
- 1160 print"";tab(13);:goto1180
- 1170 print"";
- 1180 forq=1toy+2:print"";:next q
- 1190 forq=1tox+1:print"";:next q
- 1200 print"[157]";y$:return
- 1210 gosub1170:printe$;"you win":goto1270
- 1220 print:print"i win -i'll show my hidden ships"
- 1230 forx=0to9:fory=0to9
- 1240 b=b(x,y,1):ifb=0orb>9goto1260
- 1250 y$="[209]":gosub1170
- 1260 nexty:nextx
- 1270 printz$;" another game";
- 1280 inputy$:ifleft$(y$,1)<>"n"goto270
-