10 REM THE GAME OF STAR LANES - AN INTERSTELLAR COMMERCE GAME
20 REM FOR 2-4 PLAYERS
30 REM
31 A$=CHR$(26)
32 PRINT A$
40 PRINT CHR$(12):PRINT :PRINT :PRINT TAB(10)"* S * T * A * R **";
45 DIM B(5)
50 PRINT "L * A * N * E * S *"
60 DIM M(10,13),S(5,4),N$(5),D1(5),S1(5),Q(5),R(5)
70 M$(5)="ERIDANI EXPEDITERS":FOR I=1 TO 5:FOR J=1 TO 4:S(I,J)=0
75 D1(I)=0:S1(I)=100:Q(I)=0:B(I)=6000:NEXT J,I
80 M$(3)="CAPELLA FREIGHT CO.":M$(4)="DENEBOLA SHIPPERS"
90 M$(1)="ALTAIR STARWAYS":M$(2)="BEETLEJUICE, LTD."
95 RANDOMIZE
100 L$=".+*ABCDE":M$="ABCDEFGHIJKL":FOR I=1 TO 9:FOR J=1 TO 12
110 IF INT(RND(1)*20)+1<>10 THEN M(I,J)=1:GOTO 130
120 M(I,J)=3
130 NEXT J,I:INPUT "HOW MANY PLAYERS (2-4)";P1
140 INPUT "DOES ANY PLAYER NEED INSTRUCTIONS";R$
150 IF LEFT$(R$,1)="Y" THEN IP=1: GOSUB 8000
160 FOR I=1 TO P1:PRINT "PLAYER";I;:INPUT "WHAT IS YOUR NAME";P$(I)
170 NEXT I:PRINT :PRINT "NOW I WILL DECIDE WHO GOES FIRST...":PRINT 
180 I=INT(P1*RND(1)+1):PRINT P$(I);" IS THE FIRST PLAYER TO MOVE"
185 FOR II=1 TO 1000:NEXT II
190 P=I:GOTO 220
200 SUM=0:FOR I=1 TO 5:SUM=SUM+Q(I):NEXT I:IF SUM>=70 THEN 9500
210 P=P+1:IF P=P1+1 THEN P=1
220 FOR I=1 TO 5
230 R(I)=INT(9*RND(1)+1):C(I)=INT(12*RND(1)+1)
240 FOR I1=I-1 TO 0 STEP-1:IF R(I)=R(I1) AND C(I)=C(I1) THEN 230
250 NEXT I1:IF M(R(I),C(I)) > 1 THEN 230
260 FOR I1=1 TO 5:IF Q(I1) = 0 THEN 340
270 NEXT I1:IF M(R(I),C(I)+1) > 3 OR M(R(I),C(I)-1) > 3 THEN 340
280 IF M(R(I)+1,C(I)) > 3 OR M(R(I)-1,C(I)) > 3 THEN 340
290 A1=M(R(I),C(I)+1):A2=M(R(I)-1,C(I))
300 A3=M(R(I)+1,C(I)):A4=M(R(I),C(I)-1)
310 IF A1=2 AND A2<4 AND A3<4 AND A4<4 THEN 230
315 IF A2=2 AND A1<4 AND A3<4 AND A4<4 THEN 230
320 IF A3=2 AND A1<4 AND A2<4 AND A4<4 THEN 230
325 IF A4=2 AND A1<4 AND A2<4 AND A3<4 THEN 230
330 IF A1=3 AND A2<4 AND A3<4 AND A4<4 THEN 230
335 IF A2=3 AND A1<4 AND A3<4 AND A4<4 THEN 230
336 IF A3=3 AND A1<4 AND A2<4 AND A4<4 THEN 230
340 NEXT I:GOSUB 1000:PRINT
345 IF IP THEN GOSUB 8410
350 PRINT P$(P); ", HERE ARE YOUR LEGAL MOVES FOR THIS TURN:"
360 FOR I=1 TO 5:PRINT R(I);MID$(M$,C(I),1);"/";:NEXT I:PRINT 
370 INPUT "WHAT IS YOUR MOVE";R$
371 IF LEFT$(R$,1)="M" THEN MP=1:GOSUB 1000:MP=0:GOTO 350
372 IF LEFT$(R$,1)="S" THEN GOSUB 1440:GOTO 350
375 R=VAL(LEFT$(R$,1))
380 C=ASC(RIGHT$(R$,1))-64:FOR I=1 TO 5:IF R=R(I) AND C=C(I) THEN 400
390 NEXT I:PRINT "THAT SPACE WAS NOT INCLUDED IN THE LIST...":GOTO 370
400 A1=M(R-1,C):A2=M(R+1,C):A3=M(R,C+1):A4=M(R,C-1)
410 IF A1<=1 AND A2<=1 AND A3<=1 AND A4<=1 THEN M(R,C)=2:GOTO 800
420 IF A1>3 AND A2>3 AND A1<>A2 THEN GOSUB 1060
430 IF A1>3 AND A3>3 AND A1<>A3 THEN GOSUB 1060
440 IF A1>3 AND A4>3 AND A1<>A4 THEN GOSUB 1060
450 IF A2>3 AND A3>3 AND A3<>A2 THEN GOSUB 1060
460 IF A2>3 AND A4>3 AND A2<>A4 THEN GOSUB 1060
470 IF A3>3 AND A4>3 AND A3<>A4 THEN GOSUB 1060
480 IF A1<4 AND A2<4 AND A3<4 AND A4<4 THEN 660
490 IF M(R,C)>3 THEN 800
500 IF A1>3 THEN I=A1-3
510 IF A2>3 THEN I=A2-3
520 IF A3>3 THEN I=A3-3
530 IF A4>3 THEN I=A4-3
540 Q(I)=Q(I)+1:S1(I)=S1(I)+100:M(R,C)=I+3:GOTO 700
660 FOR I=1 TO 5:IF Q(I)=0 THEN 680
670 NEXT I:IF M(R,C)<3 THEN M(R,C)=2:GOTO 800
680 GOSUB 7900:PRINT "A NEW SHIPPING COMPANY HAS BEEN FORMED"
690 PRINT "ITS NAME IS ";M$(I):S(I,P)=S(I,P)+5:Q(I)=1
695 PRINT :PRINT :PRINT :PRINT :PRINT :PRINT 
700 IF A1=3 THEN S1(I)=S1(I)+500
710 IF A2=3 THEN S1(I)=S1(I)+500
720 IF A3=3 THEN S1(I)=S1(I)+500
730 IF A4=3 THEN S1(I)=S1(I)+500
740 IF A1=2 THEN S1(I)=S1(I)+100:Q(I)=Q(I)+1:M(R-1,C)=I+3
750 IF A2=2 THEN S1(I)=S1(I)+100:Q(I)=Q(I)+1:M(R+1,C)=I+3
760 IF A3=2 THEN S1(I)=S1(I)+100:Q(I)=Q(I)+1:M(R,C+1)=I+3
770 IF A4=2 THEN S1(I)=S1(I)+100:Q(I)=Q(I)+1:M(R,C-1)=I+3
780 IF S1(I)>=3000 THEN T1=I:GOSUB 1400
790 M(R,C)=I+3
800 FOR I=1 TO 5:B(P)=B(P)+INT(.05*S(I,P)*S1(I)):NEXT I
810 FOR I=1 TO 5:IF Q(I)=0 THEN 900
815 IF IP THEN GOSUB 8410:IP=0
820 PRINT "YOUR CURRENT CASH EQUALS $";B(P)
830 PRINT "BUY HOW MANY SHARES OF ";M$(I);" AT $";S1(I):PRINT TAB(5);
840 PRINT "YOU NOW OWN";S(I,P);"  YOU CAN BUY ";INT(B(P)/S1(I));" SHARES."
850 INPUT  R3$:IF LEFT$(R3$,1)="M" THEN R3$="":MP=1: GOSUB 1000:GOTO 830
855 IF LEFT$(R3$,1)="S" THEN R3$="":GOSUB 1440:GOTO 830
856 R3=VAL(R3$):R3$=""
860 IF R3*S1(I)<=B(P) THEN 880
870 PRINT "YOU ONLY HAVE $";B(P);"-TRY AGAIN":GOTO 830
880 IF R3=0 THEN 900
890 S(I,P)=S(I,P)+R3:B(P)=B(P)-(R3*S1(I))
900 NEXT I:GOTO 200
1000 PRINT A$:PRINT TAB(22)"MAP OF THE GALAXY"
1005 IF MP=1 THEN LPRINT:LPRINT:LPRINT TAB(22)"MAP OF THE GALAXY"
1010 PRINT TAB(21)"*******************"
1015 IF MP=1 THEN LPRINT TAB(21)"*******************"
1020 PRINT TAB(12)" A  B  C  D  E  F  G  H  I  J  K  L"
1025 IF MP=1 THEN LPRINT TAB(12)" A  B  C  D  E  F  G  H  I  J  K  L"
1030 FOR R2=1 TO 9:PRINT TAB(9)R2;:FOR  C2=1 TO 12:PRINT " ";
1031 PRINT MID$(L$,M(R2,C2),1);" ";:NEXT C2:PRINT:NEXT R2
1034 IF MP=0 THEN 1050
1035 IF MP=1 THEN FOR R2=1 TO 9:LPRINT TAB(9)R2;:FOR C2=1 TO 12:LPRINT " ";
1036 LPRINT MID$(L$,M(R2,C2),1);" ";:NEXT C2:LPRINT:NEXT R2
1040 LPRINT:LPRINT
1050 RETURN
1060 F1=A1-3:IF F1<0 THEN F1=0
1061 F2=A2-3:IF F2<0 THEN F2=0
1062 F3=A3-3:IF F3<0 THEN F3=0
1063 F4=A4-3:IF F4<0 THEN F4=0
1065 T=Q(F1):T1=F1:IF Q(F2)>Q(F1) THEN T=Q(F2):T1=F2
1070 IF Q(F3)>T THEN T=Q(F3):T1=F3
1080 IF Q(F4)>T THEN T=Q(F4):T1=F4
1090 IF F1=T1 OR A1<4 THEN 1110
1100 X=F1:GOSUB 1180
1110 IF F2=T1 OR A2<4 THEN 1130
1120 X=F2:GOSUB 1180
1130 IF F3=T1 OR A3<4 THEN 1150
1140 X=F3:GOSUB 1180
1150 IF F4=T1 OR A4<4 THEN 1170
1160 X=F4:GOSUB 1180
1170 RETURN
1180 GOSUB 7900:PRINT M$(X);" HAS JUST BEEN MERGED INTO " ;
1190 PRINT M$(T1);"!":PRINT "PLEASE NOTE THE FOLLOWING TRANSACTIONS."
1200 PRINT :PRINT TAB(4)"OLD STOCK = ";M$(X);" NEW STOCK = ";
1210 PRINT M$(T1):PRINT 
1220 PRINT "PLAYER";TAB(10)"OLD STOCK";TAB(22)"NEW STOCK";TAB(34);
1230 PRINT "TOTAL HOLDINGS";TAB(53)"BONUS PAID"
1240 TS=0:FOR I1=1 TO P1:TS=TS+S(X,I1):NEXT I1:IF TS=0 THEN TS=1
1250 FOR I=1 TO P1:NS=INT((.5*S(X,I))+.5):TH=S(T1,I)+NS:BO=INT(10*((S(X,I)/TS)*S1(X)))
1260 PRINT P$(I);TAB(10)S(X,I);TAB(22)NS;TAB(34)TH;TAB(53)" $";BO
1270 S(T1,I)=TH:B(I)=B(I)+BO
1280 NEXT I
1310 FOR  I=1 TO 9:FOR  J=1 TO 12:IF M(I,J)=X+3 THEN M(I,J)=T1+3
1315 NEXT J,I
1320 Q(T1)=Q(T1)+Q(X):S1(T1)=S1(T1)+S1(X)
1340 S1(X)=100:Q(X)=0:FOR  I=1 TO P1:S(X,I)=0:NEXT I
1350 PRINT :PRINT :PRINT :PRINT :PRINT 
1360 M(R,C)=T1+3:Q(T1)=Q(T1)+1:GOSUB 9600
1365 IF S1(T1)>3000 THEN GOSUB 1400
1370 RETURN
1400 GOSUB 7900:PRINT "THE STOCK OF ";
1410 PRINT M$(T1);" HAS SPLIT 2 FOR  1!":S1(T1)=INT((S1(T1)/2+.5))
1415 PRINT :PRINT :PRINT :PRINT
1420 FOR  I1=1 TO P1:S(T1,I1)=2*S(T1,I1):NEXT I1
1425 GOSUB 9600
1430 RETURN
1440 REM
1445 LPRINT:LPRINT:LPRINT"PLAYER ";P$(P)
1450 PRINT "STOCK";TAB(30)"PRICE PER SHARE";TAB(50)"YOUR HOLDINGS"
1455 LPRINT "STOCK";TAB(30)"PRICE PER SHARE";TAB(50)"YOUR HOLDINGS"
1460 FOR  I3=1 TO 5:IF S1(I3)=100 THEN 1480
1470 PRINT M$(I3);TAB(30)S1(I3);TAB(50)S(I3,P)
1475 LPRINT M$(I3);TAB(30)S1(I3);TAB(50)S(I3,P)
1480 NEXT I3:LPRINT:LPRINT:LPRINT:LPRINT:RETURN
7900 PRINT CHR$(26):PRINT TAB(22)"SPECIAL ANNOUNCEMENT!!":PRINT 
7910 RETURN
8000 PRINT CHR$(26):PRINT "OK, HERE IS A DESCRIPTION OF 'STARLANES':":PRINT
8010 PRINT "YOU ARE COMPETING IN INTERSTELLAR COMMERCE. YOU"
8020 PRINT "WILL SEE A MAP OF THE GALAXY CONTAINING ROWS"
8030 PRINT "1 THRU 9 AND COLUMNS A THRU L. EACH POSITION WILL"
8040 PRINT "BE EITHER A '.', INDICATING SPACE, OR A '*',"
8050 PRINT "INDICATING A STAR. THE STARS ARE RANDOMLY PLACED"
8060 PRINT "ACCORDING TO WHAT SEED YOU ENTER FOR THE RANDOM"
8070 PRINT "NUMBER GENERATOR. ENTERING THE SAME SEED WILL"
8080 PRINT "PRODUCE THE SAME MAP.":PRINT
8090 PRINT "EACH TURN YOU MUST CHOOSE A MOVE FROM A SET OF"
8100 PRINT "FIVE CHOICES.":PRINT
8110 PRINT "IF YOU LAND NEXT TO A STAR, A NEW COMPANY IS"
8120 PRINT "FORMED. YOU WILL SEE THE COMPANY'S INITIAL IN THAT"
8130 PRINT "SPACE WHEN THE MAP IS DISPLAYED AGAIN.":PRINT:GOSUB 9600
8140 PRINT CHR$(26):PRINT "YOU START WITH A BANKROLL OF $6000. EACH TURN YOU"
8150 PRINT "MAY BUY SHARES IN ANY ACTIVE COMPANY (IF YOU CAN"
8160 PRINT "AFFORD THEM).":PRINT
8170 PRINT "EACH ROUND, EACH COMPANY DECLARES A 5% CASH DIV-"
8180 PRINT "IDEND.":PRINT
8190 PRINT "WHEN TWO COMPANIES COME INTO CONTACT (HORIZONTALLY"
8200 PRINT "OR VERTICALLY), A MERGER OCCURS. THE COMPANY WITH"
8210 PRINT "THE LARGEST TERRITORY ABSORBS THE SMALLER. EACH"
8220 PRINT "STOCKHOLDER IN THE ABSORBED COMPANY RECEIVES STOCK"
8230 PRINT "IN THE SURVIVING COMPANY IN THE RATIO OF ONE NEW"
8240 PRINT "FOR TWO OLD, PLUS A CASH BONUS BASED ON HIS HOLDING.":PRINT
8250 PRINT "THERE IS A MAXIMUM OF FIVE COMPANIES. WHEN ALL ARE"
8260 PRINT "ACTIVE, NO NEW COMPANY CAN BE FORMED UNTIL AFTER A"
8270 PRINT "MERGER.":PRINT
8280 PRINT "AFTER A MERGER, THE PRICE OF THE SURVIVOR'S STOCK"
8290 PRINT "IS THE SUM OF THE TWO PRIOR PRICES. IF A STOCK'S"
8300 PRINT "VALUE EXCEEDS $3000, A STOCK SPLIT OCCURS.":PRINT:GOSUB 9600
8310 PRINT CHR$(26):PRINT "IF YOU MOVE TO AN EMPTY SPACE, YOU WILL SEE A '+'"
8320 PRINT "AT THAT LOCATION. IF YOU LAND NEXT TO A '+', A NEW"
8330 PRINT "COMPANY WILL BE FORMED WITH A LOW INITIAL STOCK"
8340 PRINT "PRICE.":PRINT
8350 PRINT "THE OBJECT OF THE GAME IS TO INCREASE YOUR NET"
8360 PRINT "WORTH. THE GAME ENDS WHEN 70 POSITIONS ARE IN"
8370 PRINT "THE POSESSION OF COMPANIES.":PRINT
8380 PRINT "I WILL GIVE YOU SOME ADDITIONAL INSTRUCTIONS"
8390 PRINT "DURING THE FIRST ROUND - AFTER THAT, YOU'RE ON"
8400 PRINT "YOUR OWN - GOOD LUCK!":PRINT:GOSUB 9600:PRINT CHR$(26):RETURN
8410 PRINT "IF YOU WISH A LIST OF YOUR STOCK HOLDINGS, YOU"
8420 PRINT "MAY ANSWER THE NEXT QUESTION WITH AN 'S'."
8430 PRINT "IF YOU WISH TO REDISPLAY THE MAP, ANSWER 'M'."
8440 PRINT "IF YOUR PRINTER IS READY, YOU GET HARD COPY.":RETURN
9500 GOSUB 7900:PRINT "THE GAME IS OVER - HERE ARE THE FINAL STANDINGS"
9501 LPRINT:LPRINT:LPRINT "THE GAME IS OVER - HERE ARE THE FINAL STANDINGS"
9505 PRINT:LPRINT
9510 PRINT "PLAYER";TAB(10)"CASH VALUE OF STOCK";TAB(33)"CASH ON HAND ";
9515 LPRINT "PLAYER";TAB(10)"CASH VALUE OF STOCK";TAB(33)"CASH ON HAND";
9520 PRINT TAB(50)"NET WORTH":PRINT 
9525 LPRINT TAB(50)"NET WORTH":LPRINT
9530 FOR  I=1 TO P1:FOR  J=1 TO 5:D1(I)=D1(I)+(S1(J)*S(J,I)):NEXT J,I
9540 FOR  I=1 TO P1:PRINT P$(I);TAB(10)"$";D1(I);TAB(33)"$";B(I);
9550 PRINT TAB(50)"$";D1(I)+B(I):NEXT I
9555 FOR I=1 TO P1:LPRINT P$(I);TAB(10)"$";D1(I);TAB(33)"$";B(I);
9556 LPRINT TAB(50)"$";D1(I)+B(I):NEXT I
9557 LPRINT CHR$(12)
9560 INPUT "ANOTHER GAME";R$:IF LEFT$(R$,1)="Y" THEN 70
9565 END
9600 INPUT "HIT 'RETURN' TO CONTINUE ",Z$:RETURN
CHR$(12)
9560 INPUT "ANOTHER GAME";R$:IF LEFT$(R$,1)="Y" THEN 70
9565 END
9600 INPUT "HIT 'RETURN' TO CONTINUE ",Z$:RETUR