87 Z$="[158]"+""+"[149]"+"[156]"+"[150]"+"" 90 G=13*4096:POKEG+32,0:POKEG+33,0 100 REM*100* 110 REM 120 DIM SN$(6),SA(6),PN$(6),PS(6,6),PA(6),DN(3) 130 GOSUB 1000 140 FOR R=1 TO NR 150 :D1=INT(6*RND(1))+1 160 :D2=INT(3*RND(1))+1 170 :D3=INT(3*RND(1))+1: D3=5*2^(D3-1) 180 :PRINT: PRINT SN$(D1);DN$(D2);D3 190 :ON D2 GOSUB 5000,5300,5600 200 :GOSUB 9500 211 :PRINT "[159]"; 212 :PRINT "" 220 :PRINT BL$: PRINT BL$: PRINT "[145][145][145]" 230 NEXT R 240 FORT=1TO1500:NEXT 245 GOSUB6000:PRINT: PRINT "ONE MORE ROUND Y/N ?";: GOSUB 8000 250 IF WK$<>"N" AND WK$<>"Y" THEN PRINT M1$;M2$: GOTO 240 260 IF WK$="N" THEN LOAD "DRIVER",8 270 FOR I=1 TO N2: GOSUB 3300: NEXT I 280 IF N1=0 THEN GOSUB 7000 285 PRINT "[147]";: GOSUB 2000 290 GOTO 140 1000 REM*1000* 1020 DATA "SILVER"," IND "," GRAIN"," OIL "," GOLD "," BONDS" 1030 FOR I=1 TO 6: SA(I)=100: READ SN$(I): NEXT I 1040 DATA " UP "," DOWN"," DIV " 1050 FOR I=1 TO 3: READ DN$(I): NEXT I 1051 M1$="INVALID - " 1052 M2$="TYPE Y OR N" 1053 M3$="MUST BE 1 TO 6" 1054 M4$="MUST BE 1, 2 OR 3" 1055 M5$="TYPE B, S OR N" 1056 M6$="MUST BE A MULTIPLE OF 500" 1057 PRINT "[147][159]" 1060 PRINT "HOW MANY PLAYERS?";: GOSUB 8000: N2=VAL(WK$) 1070 IF N2<1 OR N2>6 THEN PRINT M1$;M3$: GOTO 1060 1080 IF N2=1 THEN N1=0: GOTO 1120 1090 PRINT "MAY THE COMPUTER PLAY ALSO... Y/N?";: GOSUB 8000 1100 IF WK$<>"N" AND WK$<>"Y" THEN PRINT M1$;M2$: GOTO 1090 1110 N1=0: IF WK$="N" THEN N1=1 1120 FOR I=1 TO N2 1130 :FOR J=1 TO 6: PS(I,J)=0: NEXT J 1140 :PA(I)=5000 1150 :PRINT "PLAYER";I;"WHAT IS YOUR NAME?": GOSUB 8500 1155 :PN$(I)=NA$ 1160 :IF LEN(NA$)>20 THEN PRINT "NAME TOO LONG": GOTO 1150 1165 :IF LEN(NA$)< 1 THEN PRINT "MUST HAVE NAME": GOTO 1150 1170 NEXT I 1180 PN$(0)="COMMODORE COMPUTER": PA(0)=2000 1190 FOR I=1 TO 6: PS(0,I)=500: NEXT I 1200 GOSUB 3000 1210 IF N1=0 THEN I=0: GOSUB 4000 1220 PRINT "HOW MANY COMPLETE ROUNDS BEFORE" 1230 PRINT "BUYING AND SELLING STOCKS (1-3)?"; 1240 GOSUB 8000: NR=VAL(WK$) 1250 IF NR<1 OR NR>3 THEN PRINT M1$;M4$: GOTO 1220 1260 NR=NR*(1-N1+N2): PRINT "[147]";: GOSUB 2000 1270 BL$=" " 1280 RETURN 2000 REM*2000* 2030 FOR I=190 TO 0 STEP -10 2040 :GN$=" "+STR$(I): GN$="[159]"+RIGHT$(GN$,3) 2070 :GN$=GN$+"[192][192][192]" 2080 :FOR J=1 TO 6:Z=0 2090 ::WK$="[192][192]" 2100 ::IF SA(J)>I THEN Z=-1:WK$=" [146]" 2110 ::IF SA(J)=I THEN Z=-1:WK$="[162][162]" 2120 :: 2146 IFZTHENWK$=MID$(Z$,J,1)+WK$+"[159]" 2147 ::IF J<6 THEN WK$=WK$+"[192][192][192]" 2148 GN$=GN$+WK$+"[195]" 2150 :NEXT J 2160 :PRINT GN$ 2170 NEXT I 2180 PRINT " ";SN$(1);SN$(2);SN$(3);SN$(4);SN$(5);SN$(6) 2190 RETURN 3000 REM*3000* 3020 FOR I=1 TO N2 3030 :GOSUB 4000 3040 :PRINT "YOU MUST BUY SOME STOCK" 3050 :GOSUB 9000 3100 :GOSUB 4400 3110 :IF SN=7 THEN PRINT "INSUFFICIENT FUNDS": GOTO 3050 3120 :GOSUB 3300 3130 :IF PA(I)=5000 GOTO 3030 3140 NEXT I 3150 RETURN 3300 REM*3300* 3320 GOSUB 4000 3330 PRINT "BUY, SELL OR NOTHING B/S/N ?";: GOSUB 8000 3340 IF WK$<>"N" AND WK$<>"S" AND WK$<>"B" THEN PRINT M1$;M5$: GOTO 3330 3350 IF WK$="N" THEN RETURN 3360 SB$=WK$ 3380 GOSUB 9000 3430 IF SB$="S" THEN GOSUB 4600 3440 IF SB$="B" THEN GOSUB 4400 3450 IF SN<7 THEN GOTO 3300 3460 IF SB$="S" THEN PRINT "YOU DON'T OWN ENOUGH STOCK" 3470 IF SB$="B" THEN PRINT "YOU DON'T HAVE ENOUGH MONEY" 3480 FOR K=1 TO 2000: NEXT K 3490 GOTO 3300 4000 REM*4000* 4020 PRINT "[147] PORTFOLIO - ";PN$(I) 4030 WK=LEN(PN$(I))+12: WK$=" " 4040 FOR K=1 TO WK: WK$=WK$+"[163]": NEXT K 4050 PRINT WK$ 4060 PRINT " # DESC VALUE HOLDINGS" 4070 PRINT " [163][160][160][163][163][163][163][160][160][163][163][163][163][163][160][160][163][163][163][163][163][163][163][163]" 4090 FOR K=1 TO 6 4100 :WK$=" "+STR$(SA(K)): V$=RIGHT$(WK$,3) 4130 :WK=PS(I,K): WK$=" "+STR$(WK) 4140 :WK$=RIGHT$(WK$,7) 4150 :IF WK<1000 THEN H$=" "+WK$ 4160 :IF WK> 500 THEN H$=LEFT$(WK$,4)+","+RIGHT$(WK$,3) 4170 :WK$=" "+STR$(K)+" " 4180 :PRINT WK$;SN$(K);" ";V$;" ";H$ 4190 NEXT K 4200 PRINT: PRINT "CASH ON HAND --- ";PA(I): PRINT 4210 RETURN 4400 REM*4400* 4410 WK=SA(SN)*SQ/100: PT=1 4420 IF WK>PA(I) THEN SN=7: RETURN 4430 PA(I)=PA(I)-WK 4440 PS(I,SN)=PS(I,SN)+SQ 4450 RETURN 4600 REM*4600* 4610 PT=1 4620 IF SQ>PS(I,SN) THEN SN=7: RETURN 4630 PA(I)=PA(I)+SA(SN)*SQ/100 4640 PS(I,SN)=PS(I,SN)-SQ 4650 RETURN 5000 REM*5000* 5010 SA(D1)=SA(D1)+D3 5020 IF SA(D1)<200 THEN RETURN 5030 SA(D1)=100 5040 FOR I=N1 TO N2 5050 :PS(I,D1)=PS(I,D1)*2 5060 NEXT I 5070 RETURN 5300 REM*5300* 5310 SA(D1)=SA(D1)-D3 5320 IF SA(D1)>0 THEN RETURN 5330 SA(D1)=100 5340 FOR I=N1 TO N2 5350 :PS(I,D1)=0 5360 NEXT I 5370 RETURN 5600 REM*5600* 5610 IF SA(D1)<100 THEN RETURN 5620 FOR I=N1 TO N2 5630 :PA(I)=PA(I)+PS(I,D1)*D3/100 5640 NEXT I 5650 RETURN 6000 REM*6000* 6020 PRINT "[147][159]"; 6030 PRINT "PLAYER NAME CASH VALUE" 6040 PRINT "[163][163][163][163][163][163][163][163][163][163][163] [163][163][163][163][163][163][163][163][163][163]" 6050 FOR K=N1 TO N2:S(K)=PA(K) 6060 :FOR J=1 TO 6 6070 ::PA(K)=PA(K)+SA(J)*PS(K,J)/100 6080 :NEXT J 6082 NEXT K 6084 FOR K=N1 TO N2 6086 :WK=-1 6088 :FOR J=N1 TO N2 6090 ::IF PA(J)>WK THEN WK=PA(J): I=J 6092 :NEXT J 6100 :WK$=" "+STR$(PA(I)) 6110 :WK$=RIGHT$(WK$,8): V$=LEFT$(WK$,2) 6120 :IF V$<>" " THEN V$=V$+"," 6125 :IF V$= " " THEN V$=V$+" " 6130 :V$=V$+MID$(WK$,3,3) 6140 :IF RIGHT$(V$,1)<>" " THEN V$=V$+"," 6145 :IF RIGHT$(V$,1)= " " THEN V$=V$+" " 6150 :V$=V$+RIGHT$(WK$,3) 6160 :PRINT PN$(I);TAB(21);V$: PRINT 6165 :PA(I)=-1 6170 NEXT K 6175 FORK=N1TON2:PA(K)=S(K):NEXT 6180 RETURN 7000 REM*7000* 7020 I=0: PT=0: GOSUB 4000 7030 FOR SN=1 TO 6: SQ=PS(0,SN) 7050 :IF SA(SN)<95 AND SQ>0 THEN PRINT "SELL";SQ;SN$(SN): GOSUB 4600 7060 NEXT SN 7065 FOR K=1 TO 1500: NEXT K 7070 IF PA(0)<600 THEN GOSUB 7300: RETURN 7080 WK=0:SQ=999999 7090 FOR J=1 TO 6 7100 :IF SA(J)>105 AND PS(0,J)20 THEN PRINT: RETURN 8570 GOTO 8520 8700 REM*8700* 8710 SQ=0 8720 GET WK$: IF WK$="" GOTO 8720 8730 IF WK$=CHR$(13) THEN PRINT: RETURN 8740 PRINT WK$;: SQ=SQ*10+VAL(WK$) 8750 IF WK$<"0" OR WK$>"9" THEN SQ=0: PRINT: RETURN 8760 IF SQ>999999 THEN PRINT: RETURN 8770 GOTO 8720 9000 REM*9000* 9010 PRINT "STOCK#?";: GOSUB 8000: SN=VAL(WK$) 9020 IF SN<1 OR SN>6 THEN PRINT M1$;M3$: GOTO 9010 9030 PRINT "QUANTITY? ";: GOSUB 8700 9040 WK=SQ-INT(SQ/500)*500 9050 IF SQ=0 OR WK>0 THEN PRINT M1$;M6$: GOTO 9030 9060 RETURN 9500 REM*9500* 9510 S1=32768+766+(D1-1)*6 9515 FOR K=1 TO 300: NEXT K 9520 FOR K=0 TO 190 STEP 10 9530 :WK=64 9540 :IF SA(D1)>K THEN WK=160 9550 :IF SA(D1)=K THEN WK=98 9560 :POKE S1,WK: POKE S1+1,WK 9570 :S1=S1-40 9580 NEXT K 9590 FOR K=1 TO 300: NEXT K 9600 RETURN 30000 REM*30000* RENUMBER RTN 30005 X=1025:Y=10:IN=5 30010 X1=PEEK(X+4):X2=PEEK(X+5) 30020 IF X1<>143 OR X2<>42 GOTO 30100 30030 X1=X+6:X2=0 30040 X3=PEEK(X1) 30050 IF X3=42 THEN 30090 30060 X3=X3-48 30070 IF X3<0 OR X3>9 THEN PRINT "ERR1":GOTO 30100 30080 X2=X2*10+X3:X1=X1+1:GOTO 30040 30090 IF Y