Compucolor.org – Virtual Media

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

10 REM  ***************************************************
20 REM  *                                                 *
30 REM  *               E N G I N E E R                   *
40 REM  *      WRITTEN BY ROGER AND KEITH SAFFORD         *
50 REM  *                                                 *
60 REM  *                    DO NOT COPY                  *
70 REM  *                                                 *
80 REM  ***************************************************
100 PLOT 12,6,2
103 REM
105 REM        = INSTRUCTIONS =
107 REM
110 PLOT 3,22,2:PRINT "E N G I N E E R":PRINT
120 PRINT "     TO BECOME A ENGINEER, YOU MUST CONSTRUCT A BRIDGE"
130 PRINT "CONNECTING THE FLAT PARTS AT THE TOP OF THE SCREEN.  THIS"
140 PRINT "IS DONE BY PLACING BEAMS IN ACCORDANCE WITH THE INSPECTOR'S"
150 PRINT "SPECIFICATIONS.  JUST MOVE THE SMALL DOT TO THE POSITION"
160 PRINT "YOU WISH TO PLACE THE BEAM, THEN ENTER THE DIRECTION YOU WANT"
170 PRINT "TO SET THE BEAM.  YOUR STARTING POSITION MUST BE BELOW THE"
180 PRINT "INSPECTOR'S FEET.  SEVERAL PLAYERS MAY COMPETE TO SEE WHO CAN"
190 PRINT "CONSTRUCT THE BRIDGE IN THE FEWEST DAYS.  ":PRINT
200 PRINT "WRITTEN FOR COMPUCOLOR BY:"
210 PRINT "                  KEITH SAFFORD"
220 PRINT "                  ROGER SAFFORD"
230 PRINT :INPUT "PRESS  = E N T E R =  TO BEGIN  .  .  .";Z$:PLOT 12
233 REM
235 REM        = DRAWS CANYON =
237 REM
240 DIM Y(127)
250 YH= 20:EH= 105:M= 99:N= 61
260 PLOT 30,6,2:GOSUB 600
270 W= INT (RND (8)* 4.4+ 17.8)
280 LX= INT (63- W/ 2):RX= INT (63+ W/ 2)
290 B= 1- EH/ YH
300 A= LX/ W:FOR X= 0TO LX:J= A- X/ W:F= YH* EXP (- J* J)
310 Y(X)= INT (EH+ F* B):NEXT
320 FOR X= LX+ 1TO RX- 1:Y(X)= YH:NEXT
330 A= RX/ W:FOR X= RXTO 127:J= A- X/ W:F= YH* EXP (- J* J)
340 Y(X)= INT (EH+ F* B):NEXT
350 PLOT 6,2,15,2,246,0
360 FOR X= 0TO 127:PLOT X,Y(X):NEXT :PLOT 255
453 REM
455 REM      = NEXT DAY =
457 REM
460 DA= 0
470 DA= DA+ 1
480 PLOT 6,17,3,4,24:PRINT "DAY";DA
490 PLOT 30,6,2:MO= M:NO= N:N= 30:FOR I= 1TO 3
500 N= N+ INT (RND (8)* 21):NEXT I:M= Y(N)+ 1
510 FOR I= 1TO 4:IF Y(N+ I)> M- 1THEN M= Y(N+ I)+ 1
520 NEXT I:MN= M:NN= N:N= NO:M= MO:GOSUB 600
530 PLOT 29,6,2:N= NN:M= MN:GOSUB 600
540 FOR X= 5TO 122:IF Y(X)< 104GOTO 650
550 NEXT X:PLOT 3,24,7,6,119,14
560 PLOT 32,72,32,79,32,79,32,82,32,65,32,89,32,6,18
570 END
600 PLOT 2,N,M+ 5,242,N+ 1,M+ 6,N+ 3,M+ 6,N+ 4,M+ 5,255
610 PLOT 2,N+ 2,M+ 8,242,N+ 2,M+ 3,N+ 3,M+ 2,N+ 3,M,255
620 PLOT 2,N+ 1,M+ 2,242,N+ 1,M,255:PLOT 2,N+ 2,M+ 6,255:RETURN
643 REM
645 REM     = PLACE DOT =
647 REM
650 X= INT (RND (8)* 32+ RND (8)* 32+ 32)
660 IF X> N- 1AND X< N+ 5GOTO 650
670 Y= Y(X)+ 18:XO= X:YO= Y:PLOT 6,2,29,2,X,Y,255
673 REM
675 REM     = MOVE DOT =
677 REM
730 GOSUB 10000
740 K= K- 68:IF K> 14THEN K= INT ((K- 6)/ 4)
750 IF K> 0THEN ON KGOTO 790,770,820
760 GOTO 730
770 IF X> N- 1AND X< N+ 5AND Y< M+ 10AND Y> M- 1GOTO 730
780 Y= Y- 1:GOTO 850
790 IF X> N- 2AND X< N+ 5AND Y< M+ 9AND Y> M- 1GOTO 730
800 IF X> 122THEN GOTO 730
810 X= X+ 1:GOTO 850
820 IF X> N- 1AND X< N+ 6AND Y< M+ 9AND Y> M- 1GOTO 730
830 IF X< 5GOTO 730
840 X= X- 1
850 PLOT 6,2,30,2,XO,YO,255:XO= X:YO= Y
855 IF Y> Y(X)THEN PLOT 2,X,Y,255:GOTO 730
860 IF Y< MGOTO 890
870 PLOT 3,7,30,6,16:PRINT "CONSTUCTION MUST BE BELOW THE INSPECTOR !"
880 FOR I= 1TO 1500:NEXT I:PLOT 3,7,30,6,18,11:GOTO 470
890 PLOT 3,20,30,6,17:PRINT "CONSTRUCT WITH ARROWS":GOSUB 10000
900 PLOT 11:IF K> 24THEN K= K- 24:IF K> 2THEN K= K- 1
910 L= INT (RND (8)* 5)+ 14:PLOT 30:ON KGOTO 930,990,1040
920 GOTO 890
930 T= 0:FOR I= X+ LTO XSTEP - 1
940 IF Y< Y(I+ 1)+ 1THEN T= I
950 IF T= 0AND Y< Y(I)+ 2THEN T= I
960 NEXT I:IF T= 0GOTO 16000
970 PLOT 29,6,2,2,X,Y,242,T,Y,255
980 FOR I= XTO T:IF Y> Y(I)THEN Y(I)= Y
985 NEXT I:GOTO 470
990 T= 0:FOR I= X- LTO X
1000 IF Y< Y(I- 1)+ 1THEN T= I
1010 IF T= 0AND Y< Y(I)+ 2THEN T= I
1020 NEXT I:IF T= 0GOTO 16000
1030 I= T:T= X:X= I:GOTO 970
1040 T= 0:T= INT (L- RND (8)* 3)+ Y(X)
1050 IF X> N- 1AND X< N+ 5AND T> M- 1THEN T= M- 1
1055 IF T> 105THEN T= 105
1060 Y(X)= T:PLOT 29,6,2,2,X,Y,242,X,T,255:GOTO 470
10000 POKE 33278,0:PLOT 3,0,30,6,18
10010 K= PEEK (33278):IF K= 0GOTO 10010
10020 PLOT 11:RETURN
15000 TM= PEEK (32941)* 256+ PEEK (32940)- 7
15010 RESTORE 15010:DATA 245,175,50,255,129,241,201
15020 FOR J= 0TO 6:READ DS:POKE TM+ 1+ J,DS:NEXT
15030 BR= INT (TM/ 256):POKE 33221,195
15040 POKE 33222,TM- BR* 256+ 1:POKE 33223,BR
15050 POKE 32941,BR:POKE 32940,TM- BR* 256:RETURN
16000 PLOT 3,20,30,6,16:PRINT "BEAM MUST BE SUPPORTED"
16010 GOTO 470