SUBROUTINE BASE(JX,MX,MISS,IFIRE,SH) INTEGER SH(5,4) LOGICAL*1 A COMMON /BLK3/ISTAT D TYPE *,' BASE' A=ITTINR() !Try for 1 char or IF (A.LT.0) GOTO 40 !No,go-see if missile in flight IF (A.EQ.' ') GOTO 10 !Space,go to fire missile IF (A.EQ.',') GOTO 20 !',' Move base to left IF (A.EQ.'.') GOTO 30 !'.' Move base to right IF (A.EQ.'A') GOTO 5 !'A' ABORT GAME IF (A.NE.'Z') GOTO 40 !'Z' Clear screen and abort game CALL CLEAR 5 JI=IPOKE("44,ISTAT) CALL EXIT !STOP 10 IF (IFIRE.EQ.1) GOTO 40 !Missile in flight,go and move it DO 100 I=1,5 DO 100 J=1,4 !see if we fired into shelter IPOS=SH(I,J) !Does this one exist IF (IPOS.EQ.0) GOTO 100 !No ignore it IPOS=(13*I)+J !Yes,calculate position IF (JX.NE.IPOS) GOTO 100 !are we underneath SH(I,J)=SH(I,J)-1 !Yes Knock it down by one GOTO 60 !Go to move Base 100 CONTINUE MX=JX !Say were missile is IFIRE=1 !Say it has been released GOTO 40 !goto move it 20 IF (JX.LT.5) GOTO 40 !if too far over can't move JX=JX-1 !one to left GOTO 40 30 IF (JX.GT.75) GOTO 40 JX=JX+1 !one to right 40 IF (IFIRE.EQ.0) GOTO 60 !No missile set up base IF (MISS.LT.22) GOTO 50 !If not at Top Carry on CALL POSITN(MX,MISS+1) !Delete | WRITE(5,90) IFIRE=0 !Say free to fire again MISS=0 !Say missile is at ground GOTO 60 !goto setup base 50 MISS=MISS+2 !Move missile upwards CALL POSITN(MX,MISS+1) !Draw it WRITE(5,80) CALL POSITN(MX,MISS-1) !Clear it's old position WRITE(5,90) 60 CALL POSITN(JX-1,1) !Position of base WRITE(5,70) !Draw it RETURN C C Formats for missile and base C 70 FORMAT('$ Y ') 80 FORMAT('$^') 90 FORMAT('$ ') END