      SUBROUTINE QQMOVE                                                 3391

c	include 'tcommon.for'
	%include tcommon.for

C     ...ROMULANS AND KLINGONS MOVE FROM QUADRANT TO QUADRANT TOWARDS   3411
C     ...BASES.                                                         3412
      XTOT=NKL+MROM                                                     3413
      YTOT=LEFTK+LEFTR                                                  3414
      PRQMV=SQRT(1.-YTOT/XTOT)                                          3415
C     ...PRQMV IS PROBABILITY THAT ENEMY WILL MOVE OUT OF A QUADRANT.   3416
C     ...DON'T SELECT QUADRANTS WITH BASES IN THEM OR E IN.             3417
      DO 1000 I=1,NQUAD                                                 3418
      DO 1000 J=1,NQUAD                                                 3419
      IF(I.EQ.ICE.AND.J.EQ.JCE)GO TO 1000                               3420
      IK=JGAL(I,J)                                                      3421
      IF(IK.LE.99)GO TO 1000                                            3422
      IF(IK-IK/100*100.GT.9)GO TO 1000                                  3423
      IF(RAN(IZZ).GT.PRQMV)GO TO 1000                                   3424
C     ...MOVE MAX OF 1K + 1R.                                           3425
      X=I                                                               3426
      Y=J                                                               3427
      M=99                                                              3428
      N=99                                                              3429
C     ...FIND NEAREST QUAD WITH BASE.                                   3430
      DIST=1.E9                                                         3431
      DO 100 K=1,NQUAD                                                  3432
      DO 100 L=1,NQUAD                                                  3433
      IF(JGAL(K,L)-JGAL(K,L)/100*100.LE.9)GO TO 100                     3434
      U=K                                                               3435
      V=L                                                               3436
      Z=RANGE(X,U,Y,V)                                                  3437
      IF(Z.GE.DIST)GO TO 100                                            3438
      DIST=Z                                                            3439
      M=K                                                               3440
      N=L                                                               3441
100   CONTINUE                                                          3442
      IF(M.EQ.99)GO TO 9999                                             3443
      M=M-I                                                             3444
      N=N-J                                                             3445
      IM=1                                                              3446
      JM=1                                                              3447
      K=ISIGN(1,M)+I                                                    3448
      IF(M.EQ.0)K=I                                                     3449
      L=ISIGN(1,N)+J                                                    3450
      IF(N.EQ.0)L=J                                                     3451
      IF(K.EQ.ICE.AND.L.EQ.JCE)GO TO 1000                               3452
      JK=JGAL(K,L)                                                      3453
C     ...ROMULANS FIRST, THEN KLINGONS. NOTE THAT IGAL IS NOT UPDATED!  3454
C     ...NO MORE THAN 99XX IN A QUADRANT.                               3455
      IF(IK.LT.1000)GO TO 200                                           3456
      IF(JK.GE.9000)GO TO 200                                           3457
      JGAL(I,J)=JGAL(I,J)-1000                                          3458
      JGAL(K,L)=JGAL(K,L)+1000                                          3459
200   IF(IK-IK/1000*1000.LT.100)GO TO 1000                              3460
      IF(JK-JK/1000*1000.GE.900)GO TO 1000                              3461
      JGAL(I,J)=JGAL(I,J)-100                                           3462
      JGAL(K,L)=JGAL(K,L)+100                                           3463
1000  CONTINUE                                                          3464
9999  RETURN                                                            3465
      END                                                               3466
XRAT 
704   FORMAT(1X,A10,' EFFECTIVENESS INCREASED BY ',I3,'%')    
4     IF(ETVEL.EQ.ETVEL0)GO TO 5
    