Compucolor.org – Virtual Media

Listing of file='ARTSEL.BAS;01' on disk='vmedia/ncc_4-sector.ccvf'

5 REM  SET PRICES AND RANGES
10 DIM P(5),S(5),F(5)
20 FOR I= 1TO 5
30 P(I)= 100+ INT (900* RND (1))
40 S(I)= INT (P(I)* RND (1))
50 IF P(I)< 500THEN S(I)= INT (P(I)* .7* RND (1))
60 F(I)= 0
70 NEXT I
95 REM   BUY PAINTINGS
100 FOR I= 1TO 5
110 GOSUB 500
120 PRINT :PRINT "BUY PAINTING";I:PRINT :PRINT
130 PRINT "PRICES:";INT (P(I)- .5* S(I));P(I);INT (P(I)+ .5* S(I))
140 PRINT :PRINT :INPUT "YOUR BID? ";YB
150 PRINT "OPPONENT'S BID ";CB;"."
160 IF YB> CBTHEN PRINT "YOU BOUGHT IT.":F(I)= YB:GOTO 180
170 PRINT "YOU WERE OUT BID."
180 NEXT I
195 REM  SELL PAINTINGS
200 FOR I= 1TO 5
210 IF F(I)= 0THEN 310
220 FOR K= 1TO INT (5* RND (1))
230 GOSUB 500:CB= CB+ INT (100* RND (1))
240 PRINT "SELL PAINTINGS ";I
250 PRINT "YOU BOUGHT IT FOR ";F(I):PRINT "AVERAGE OFFER IS ";P(I)+ 50
260 PRINT "OFFER ";K;"IS ";CB;"."
270 INPUT "ACCEPT ";Y$
280 IF Y$= "Y"THEN 300
290 NEXT K
300 P= P+ CB- F(I)
310 NEXT I
320 PRINT :PRINT "YOUR PROFIT IS ";P;"."
330 INPUT "PLAY AGAIN? ";Y$
340 IF Y$= "Y"THEN RUN
350 END
495 REM   NORMAL DISTRIBUTION SUBROUTINE
500 D= 0
510 N= INT (65536* RND (1))
520 FOR J= 1TO 16
530 Q= INT (N/ 2)
540 D= D+ 2* (N/ 2- Q)
550 N= Q
560 NEXT J
570 CB= (P(I)+ S(I)* D- 8)/ 8
580 CB= CB+ 20* RND (1)
590 CB= INT (CB)
600 RETURN