home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 226
/
226.d81
/
acquire
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
23KB
|
786 lines
80 gosub18000:clr
90 rem acquire 38 1.8.85
95 x=rnd(-rnd(0))
100 dimt$(108),t1$(108),b$(13,10)
140 def fnz(x)=len(str$(x))-1
150 forq=1to7:readh$(q),bv(q),ct$(q),ce(q),pv(q),mn(q):hi$(q)=left$(h$(q),2)
155 sa(q)=25:next
160 tr=108:forq=1to108:readt1$(q):next
170 tg$="[213][192][192][192][201][157][157][157][157][157][221][221][157][157][157][157][157][202][192][192][192][203][145][157][157][157][157]":sp=1037:cz=54272:hw$="ltafwci":ha=7
175 og$="[176][192][174][157][157][157][221] [221][157][157][157][173][192][189][145][157][157]"
180 cd$=""
190 poke53281,1
195 input"[147][151]what is your name";nm$
197 x=(12-len(nm$))/2:forq=1tox:x$=x$+" ":next
200 p$(1)=x$+nm$
205 print"how many computer opponents[160]do you want,"
210 printnm$" (3 - 5)";:inputa
220 ifa<3ora>5thenprint"[145][145][145][145][145][145]":goto205
221 print"do you want to see other players':":
222 printtab(10)"share holdings";:inputa$
223 ifa$<>"n"thensk=1
224 printtab(11)"cash holdings";:inputa$
225 ifa$<>"n"thenck=1
226 printtab(13)"total worth";:inputa$
227 ifa$<>"n"thenvk=1
230 np=a+1
240 forq=1tonp:m(q)=6000:next
250 print"[151]o.k., "nm$", you are player no. 1"
260 gosub11110
300 rem board
310 print"[147]";:poke53281,0:poke53280,0
320 printtab(15)"[153]a b c d e f g h i j k l"
330 printtab(14)"[152][176][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][174]"
340 g1$="[152][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221]"
344 om(n3(1))=m(n3(1))+b1
350 g2$="[152][171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179]"
360 forq=1to8:printtab(13)"[153]"right$(str$(q),1);g1$:printtab(14)g2$:next
370 printtab(13)"[153]9"g1$
380 printtab(14)"[152][173][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][189]"
400 rem tile shuffling
410 print"please wait":print" while the "
420 print" tiles are ":print" shuffled "
430 forq=1to108:t$(q)=t1$(q):next:forq=1to108
440 x=int(rnd(1)*108+1):t1$=t$(q)
450 t$(q)=t$(x):t$(x)=t1$
460 next
469 rem set share distrib factor
470 forq=1tonp
475 x=int(rnd(1)*3+1)
480 df(q)=x+2:next
490 gosub10100
500 rem draw first np tiles
510 print"players draw":print"for starting"
520 bt=21:forq=1tonp
530 print"[153]player"q:print" draws tile"
540 print""tg$"[153]"t$(q)
550 t$=t$(q):tr=tr-1:gosub11000
560 pokep,q+48:pokep+cz,1:p(q)=p
565 b$(v,h)="o"
570 ifv+h<btthenbt=v+h:bp=q
575 gosub11110
580 nextq
590 pokep(bp)+cz,14:print" [154]player"bp:print" starts":t=np+1:pl=bp
600 forq=1to3000:next
610 forq=1tonp:pokep(q),81:pokep(q)+cz,1:next
700 rem players draw tiles
710 gosub10100:print"players now":print"draw 6 tiles":print" each "
712 print" "
715 print"your tiles,":print" money and ":print" shares are ":print"shown below"
720 forq=1tonp:forj=1to6
730 th$(q,j)=t$(t):t=t+1:tr=tr-1:next:next
740 gosub17000
760 ift>6*(np+1)+1goto980
780 gosub13200
790 gosub10000
980 gosub10100:poke1463,pl+48:poke55735,2:ifpl=1goto7000
990 print" "pl"'s turn"
995 gosub11110
1000 rem play
1010 q=0:im=0:pn(pl)=0:forj=1to7:im(j)=0:so(j)=0:next
1015 q=q+1:ifq=7goto1500
1017 ifth$(pl,q)=""goto1015
1020 lc(q)=0:pm=0:lc=0:h3=0:h4=0:t$=th$(pl,q):gosub11000:forj=1to3:pm(j)=0:next
1025 ut=0
1030 v(q)=v:h(q)=h:p(q)=p
1040 lr$=b$(v,h-1):iflr$=""goto1060
1050 gosub12000
1060 lr$=b$(v+1,h):iflr$=""goto1080
1070 gosub12000
1080 lr$=b$(v,h+1):iflr$=""goto1100
1090 gosub12000
1100 lr$=b$(v-1,h):iflr$=""goto1115
1110 gosub12000
1115 lc(q)=lc:ifpl=1goto7060
1120 iflc=0andpm=0thents(q)=5:goto1190
1130 iflc>0andpm=0thengosub12100
1131 rem 'o' link, no possible mergers - new hotel possibility
1135 ifts(q)=-5goto1015
1140 ifts(q)=7thenbt=q:bs=7:goto1540
1150 ifpm=>2thengosub12250
1155 ifut=1goto1200
1160 ifpm=1thengosub12500
1190 goto1015
1200 rem unplayable tile
1205 iftr<2thenth$(pl,q)="":ts(q)=-5:goto1015
1210 print"[153]i have to":print"change my"
1212 print"tile "th$(pl,q):print"(unplayable)"
1220 t=t+1:tr=tr-1:th$(pl,q)=t$(t):gosub11100:gosub10100:goto1020
1500 rem select comp's best
1510 bt=0:bs=-1:forq=1to6
1520 ifts(q)>bsthenbs=ts(q):bt=q
1530 next:ifbs>0goto1540
1533 print"[153] sorry! no":print"playable":print"tiles. turn"
1535 print" passes to":print" purchases[146]":gosub11100:goto5000
1540 gosub13000 rem placing
1550 onbsgoto3200,3200,2400,2400,2800,3200,4200
2400 rem add tile
2410 e1=0:x=hh(bt):b$(v(bt),h(bt))=hi$(x)
2420 pokep(bt)+cz,ce(x):hs(x)=hs(x)+1
2430 ifhs(x)=41theneb=1:goto2440
2435 ifhs(x)=11thene1=1
2440 gosub11500:print""tab(mn(x))h$(x):print"chain grows":ifhs(x)<11goto2450
2445 ifsc(x)=0thensc(x)=1:print" and is now ":print" safe from ":print" takeover "
2450 gosub11800:gosub11100
2460 ifeb=0orfb=1goto2500
2470 fb=1:gosub10100:gosub15750:goto5000
2500 ifes=0ande1=1thengosub15500
2510 ifes=0oret=1goto5000
2520 gosub10100:et=1:gosub15760:goto5000
2800 rem isolated tile
2810 b$(v(bt),h(bt))="o":goto5000
3200 rem merger
3210 pokep(bt),86:forq=1to1500:next:gosub10100
3220 forq=1to10:print" merger!"
3230 forj=1to100:next
3240 print" merger!":forj=1to100:next:next
3242 ifhs(mp(bt,1))<>hs(mp(bt,2))orpl>1goto3250
3245 gosub13500
3250 h1=mp(bt,1):h2=mp(bt,2):h3=mp(bt,3)
3255 print""tab(mn(h1))h$(h1):print"[155]takes over":printtab(mn(h2))h$(h2)
3260 ifh3>0thengosub10200
3262 b1=sv(h2)*10:b2=b1/2:rem boni
3265 print"[152]bonuses are":print" $"b1:print" & $"b2:gosub10000
3270 gosub10100:print"shares held":print" in mergee"
3275 print"pl. "ct$(h2)"shs.":print"[163][163][163] "ct$(h2)"[163][163][163]"
3280 forq=1tonp:n1(q)=s(q,h2):next
3285 forq=1tonp
3290 n=n1(q)
3295 forj=1tonp
3300 ifn1(j)=>nthenn=n1(j):xx=j
3305 nextj:n2(q)=n:n1(xx)=0:n3(q)=xx
3310 ifn2(q)>0thenprint""n3(q)" "ct$(h2);n2(q)""
3315 nextq:print""
3340 ifn2(2)>0goto3370
3350 print" player"n3(1):print"scoops pool!":print"gets $"b1+b2
3360 m(n3(1))=m(n3(1))+b1+b2:goto3500
3370 ifn2(1)<>n2(2)orn2(2)<>n2(3)goto3400
3375 nw=3:ifn2(3)=n2(4)thennw=4
3380 x=int((b1+b2)/nw):forq=1tonw:m(n3(q))=m(n3(q))+x:next
3385 printright$(str$(nw),1)"-way split!":print" players"
3387 ifnw=4thenprintn3(1)"[157]"n3(2)"[157]"n3(3)"&"n3(4):goto3395
3390 print" "n3(1)n3(2)"&"n3(3)
3395 print" get $"x:print" each":goto3500
3400 ifn2(1)<>n2(2)goto3440
3410 x=(b1+b2)/2:forq=1to2:m(n3(q))=m(n3(q))+x:next
3420 print" share-out!":print" players":print" "n3(1)"&"n3(2)"get"
3430 print"$"x"each":goto3500
3440 m(n3(1))=m(n3(1))+b1
3450 print" player"n3(1):print"gets $"b1
3460 ifn2(2)<>n2(3)goto3490
3465 nw=2:ifn2(3)=n2(4)thennw=3
3470 x=int(b2/nw):forq=2tonw+1:m(n3(q))=m(n3(q))+x:next
3475 print" players":ifnw=3thenprintn3(2)"[157]"n3(3)"&"n3(4)"get":goto3485
3480 print" "n3(2)"&"n3(3)"get"
3485 print"$"x"each":goto3500
3490 m(n3(2))=m(n3(2))+b2
3495 print" player"n3(2):print"gets $"b2
3500 gosub13200:gosub10000
3600 gosub10100:print" merger":print" decisions:"
3605 hs(h1)=hs(h1)+hs(h2)+1:x=h1:gosub11800
3607 hs(h2)=0:hu(h2)=0:ha=ha+1:ifsa(h2)>0thensa=sa-1
3610 sc=0:forz=pltopl+np-1:ts=0:ns=0:ne=0:nk=0:n%=0
3620 q=z:ifq>npthenq=z-np
3625 ifs(q,h2)=0goto4055
3627 sc=sc+1:ifsc=4thensc=0:gosub10000:gosub10100:print""
3629 rem selling
3630 m=m(q):n=0:ss=s(q,h2):print" player"q"[157] "
3635 ifq=1thenprint"press a key[146]":gosub10000:goto7100
3637 br$="[157][157][157]( ":ifss>9thenbr$="[157][157][157][157]( "
3638 print" "ss;br$;"shares)":ifsa=0goto3739
3640 forj=1to7:ifhu(j)=0orsa(j)=0goto3660
3650 n=n+sv(j)
3660 nextj:av=n*3/sa
3670 ifav<=mgoto3739:rem test money
3690 ns=ns+1:ifm+ns*sv(h2)<avgoto3690
3700 ifns=>s(q,h2)thenns=s(q,h2)
3710 s(q,h2)=s(q,h2)-ns:sa(h2)=sa(h2)+ns:m(q)=m+sv(h2)*ns
3720 ifs(q,h2)=0ors(q,h2)-nk=0goto3980
3739 rem changing
3750 ifq=1goto3820
3755 ifsa(h1)=0ors(q,h2)=1goto3900
3760 ifhs(h1)<11orsv(h1)-sv(h2)=>300goto3799
3770 ifs(q,h1)=>14-npors(q,h1)<(25-sa(h1))/np-4goto3900
3799 rem exchange
3800 ne=int(s(q,h2)/2)
3810 ifsa(h1)<nethenne=ne-1:goto3810
3820 s(q,h2)=s(q