-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path6.FOR
92 lines (78 loc) · 2.52 KB
/
6.FOR
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
C SUBROUTINE 6
* THIS HAS BEEN REWRITTEN IN MACRO (EXACT EQUIVALENT)
C INTEGER FUNCTION ORDER(I6)
C IMPLICIT INTEGER(A-Z)
C ORDER=0
C IF((I6<101).OR.(I6>5900).OR.(I6/100*100==I6)
C &.OR.(I6/100*100+1==I6)) ORDER=1
C RETURN
C END
INTEGER FUNCTION IFORM(I)
IFORM=IABS(I/10000)
RETURN
END
INTEGER FUNCTION ILATT(I)
ILATT=IABS(MOD(I,10000))
RETURN
END
SUBROUTINE SONAR(Z6)
INCLUDE 'COMMON.EMP/NOLIST'
DIMENSION OK(5)
DATA OK/'+',' ','X','*','O'/
DO 100 I=1,8
LOCUS=Z6+IARROW(I)
AB=A(1,LOCUS)
IF(AB#A(0,LOCUS)) CALL CHANGE(LOCUS,AB,0)
IF((AB#'*').AND.(AB#'O')) GOTO 200
DO 300 I1=1,70
300 IF(TARGET(I1)==LOCUS) GOTO 100
DO 301 I1=1,70
301 IF(TARGET(I1)==0) GOTO 302
302 TARGET(I1)=LOCUS
GOTO 100
200 IF((AB<'A').OR.(AB>'T')) GOTO 100
IF(AB#'A') GOTO 201
* WE MUST NOW FIGURE OUT IF THE ARMY IS A THREAT TO ANY OF THE COMPUTER'S
* CITIES, I.E. IF IT IS ON THE CONTINENT WITH ANY OF THEM. IF SO, PUT
* THE ARMY IN THE LOCI ARRAY. THE FIRST INDEX IS THE CONTINENT, THE
* SECOND IS THE NTH ARMY DISCOVERED ON THAT CONTINENT - 1. THE (N,1)
* ARGUMENT IS THE DATE OF THE LAST ARMY DISCOVERED ON THE
* NTH CONTINENT. THUS WE HAVE A MEANS OF DETERMINING THE AGE OF THE DATA.
DO 901 K=1,70
IF((OWNER(K)#2).OR.(PHASE(K)==1)) GOTO 901
IF(FOUND(K)#MDATE+5*PHASE(K)-1) GOTO 901
MOVE=PATH(X(K),LOCUS,1,OK,FLAG)
IF(FLAG#0) PHASE(K)=-1
901 CONTINUE
DO 903 K=1,10
IF(LOCI(K,1)<MDATE+26) GOTO 903 !IF DATA IS NOT OLD
DO 904 J=2,11
904 LOCI(K,J)=0 !ZERO THAT LINE
903 CONTINUE
DO 902 K=1,10
IF(LOCI(K,2)==0) GOTO 906
MOVE=PATH(LOCUS,LOCI(K,2),1,OK,FLAG)
IF(FLAG==0) GOTO 902
906 LOCI(K,1)=MDATE
DO 905 J=11,3,-1
905 LOCI(K,J)=LOCI(K,J-1) !SHIFT EVERYTHING UP THE ARRAY
LOCI(K,2)=LOCUS
GOTO 100
902 CONTINUE
201 ISHIPT=0
IF(AB=='D') ISHIPT=1
IF(AB=='S') ISHIPT=2
IF(AB=='T') ISHIPT=3
IF(AB=='R') ISHIPT=4
IF(AB=='C') ISHIPT=5
IF(AB=='B') ISHIPT=6
IF(ISHIPT==0) GOTO 100
DO 202 IB=1,4
202 TROOPT(ISHIPT,IB)=TROOPT(ISHIPT,IB+1)
TROOPT(ISHIPT,5)=LOCUS
100 CONTINUE
CALL CHANGE(Z6,A(1,Z6),0)
IF(CODER==10.) CALL SENSOR(Z6)
RETURN
END
.