	SUBROUTINE MOVE(ID,IS)
C	ROUTINE TO ADVANCE CRAWLER FORWARD ONE SPACE
C	ID IS CRAWLER ID
C	IS IS STATUS OF MOVE - 1=SUCCESS
C			       <0=HIT WALL; MOVE IMPOSSIBLE
C----------------------standard common block----------------------------
C 
	COMMON ICR(8,12),IPARM(10),IS1,IS2,NT,ICU(10,10,10,2),CLEAR(8)
	COMMON MARKER(4,3,3)
	LOGICAL*1 ICU,CLEAR
C 
C-----------------------------------------------------------------------
	LOGICAL*1 A
	LUN=ICR(ID,8)
	IF(ICR(ID,9).LT.3) GOTO 11 !  ENERGY TOO LOW
	IX=0
	IY=0
	IZ=0
	IF(ICR(ID,2).EQ.1) IX=1
	IF(ICR(ID,2).EQ.2) IY=1
	IF(ICR(ID,2).EQ.3) IX=-1
	IF(ICR(ID,2).EQ.4) IY=-1
	IF(ICR(ID,2).EQ.5) IZ=1
	IF(ICR(ID,2).EQ.6) IZ=-1
	I=ICR(ID,10)
	J=ICR(ID,11)
	K=ICR(ID,12)
	I1=I+IX
	J1=J+IY
	K1=K+IZ
	IF(I1.GT.10.OR.I1.LT.1) GOTO 1 ! AT CUBE FACE, NEED DOOR TO MOVE
	IF(J1.GT.10.OR.J1.LT.1) GOTO 1
	IF(K1.GT.10.OR.K1.LT.1) GOTO 1
	A=ICU(I1,J1,K1,1)
	IF(A.NE.' '.AND.A.NE.'[') GOTO 2  ! OBSTRUCTION
C 
C	MOVE MUST BE POSSIBLE:
	M=0
	IF(A.EQ.'[') M=10
	ICU(I1,J1,K1,1)=ID+48+M  ! CONVERT ID TO CHARACTER
C	(IF THERE WAS A DOOR, THERE IS NOW A DOOR AND A CRAWLER.)
C	(ADD 10 TO CODE FOR CRAWLER TO REPRESENT DOOR.)
	A=ICU(I,J,K,1)
	ICU(I,J,K,1)=' '  ! CLEAR OLD POSITION
	IF(IS.NE.-5) GOTO 60  ! NOT A CUBE CRAWLER
	ICU(I,J,K,1)='*'  ! DESTROY OLD POSITION
C	DEBUG:
	IF(IPARM(3).EQ.1) WRITE(LUN,61) ID,I,J,K
	GOTO 27
61	FORMAT(' crawler',I2,' has destroyed an empty area at',3I3)
60	IF(A.GT.'8'.AND.A.LT.'C') ICU(I,J,K,1)='['  ! RESTORE DOOR
C	(CRAWLER MOVES OFF DOOR -> 'C'='8'+11)
27	ICR(ID,9)=ICR(ID,9)-3 ! DEPLETE ENERGY
	ICR(ID,10)=I1  ! UPDATE CRAWLER POSITION
	ICR(ID,11)=J1
	ICR(ID,12)=K1
	IF(ICR(ID,1).LT.3.OR.IPARM(1).EQ.0) WRITE(LUN,12)
12	FORMAT(' ........rumble...rrumble..rrrr...rrummmbble....'/
     C'    ......rrrrrrr.....rrumble.........')
	IS=1
	GOTO 10  ! RETURN
C 
C	ATTEMPT TO MOVE PAST WALL BOUNDARIES:
1	A=ICU(I,J,K,1)
	IF(A.LT.'9'.OR.A.GT.'B') GOTO 13  ! NOT ON A DOOR
C	IF THERE IS A DOOR BEHIND CRAWLER ON SPOT, THERE WILL BE
C	A CRASH ANYWAYS; DON'T NEED TO CHECK FOR HIDDEN DOOR.
	ICR(ID,1)=ICR(ID,1)+1   ! CHANGE STATUS
C	COORDINATES REMAIN UNCHANGED
	ICR(ID,9)=ICR(ID,9)-3  ! DRAIN ENERGY
	ICU(I,J,K,1)='[' ! PUT DOORWAY BACK IN OLD POSITION
	IF(ICR(ID,1).LT.3.OR.IPARM(1).EQ.0) WRITE(LUN,12)
	IF(ICR(ID,1).LT.3.OR.IPARM(1).EQ.1) WRITE(LUN,14)
14	FORMAT(' ..rumble....rum..   hey, you`re outside'/
     C'     the cube !!!!')
	ICR(ID,9)=ICR(ID,9)+2
	CALL ROTATE('D',ID)  !  KEEP CRAWLER BOTTOM ON CUBE SURFACE
	GOTO 10 ! RETURN
C 
C	OBSTRUCTION:
2	IF(A.EQ.'*') GOTO 15 ! HIT DESTROYED AREA
	IF(A.LE.'8'.AND.A.GE.'1') GOTO 16 ! CRASH INTO CRAWLER
	IF(IS.EQ.-5) GOTO 10
	GOTO 25  ! UFO
10	RETURN
11	IF(ICR(ID,1).LT.3.OR.IPARM(1).EQ.1) WRITE(LUN,17)
17	FORMAT(' .....rumble...rr..<gasp>...rrr..<sputter>...'/
     C' ....feed me !!!.............uuh......')
	GOTO 10
C 
C	DEATH MOVES:
13	IF(ICR(ID,1).LT.3) WRITE(LUN,18)
18	FORMAT(' .....rumble...rr...OUCH !   there`s no door'/
     C' on this wall........'//
     C' .......you had best return to crawler training school.')
	IF(IS.EQ.-5) GOTO 10
	ICR(ID,9)=ICR(ID,9)-1
	GOTO 10
15	IF(IS.EQ.-5) GOTO 10
	WRITE(LUN,19)
19	FORMAT(' ...rumble..rumble...>  > >>boom<< < <........'//
     C' alas, you have wandered into a destroyed area.  the cube will'/
     C' consume your crawler for breakfast tomorrow.')
	ICR(ID,1)=0
	ICU(I1,J1,K1,1)='*'
	GOTO 10
16	IM=ICR(A-48,1)
	IF(IM.NE.1.AND.IM.NE.2.AND.IS.EQ.-5) GOTO 10
	IF(NT.LT.4) GOTO 716
	IF(ICR(ID,1).LT.3.OR.IPARM(1).EQ.1) WRITE(LUN,20) A
20	FORMAT(' .....rumble...rumble..rum >   >  > >>boom<< <  <   <'//
     C' >   >  > >>>boom<<< <  <   < ......what a mess !'//
     C' you have rammed crawler ',A1,', destroying'/
     C' both crawlers.  the cube will feast on the remains.')
	IS=A-"60  ! CONVERT CHARACTER 3 TO INTEGER 3, ETC.
	WRITE(ICR(IS,8),21) IS,ID
21	FORMAT(' ...........>   >  > >>>boom<<< <  <   <..............'/
     C/' crawler',I2,', you have just been rammed by crawler',I2,'.'/
     C' both of you have been reduced to a pile of rubble....')
	ICR(ID,1)=0
	ICR(IS,1)=0
	ICU(I1,J1,K1,1)='*'
	GOTO 10
C 
716	WRITE(LUN,717)
717	FORMAT(' ....rummmble......rummble.....rrrum.....'/
     C' ........rumble....>>ZONK<<'//
     C' you can`t ram another crawler until after the'/
     C' third turn.....')
	GOTO 10
25	IF(ICR(ID,1).LT.3.OR.IPARM(1).EQ.1) WRITE(LUN,26) A
26	FORMAT(' ....rumble......rumb.. hey, what`s this ?'/
     C' an unidentified object bearing the characters ',O3,' has'/
     C' just been trounced to the death.......rumble..rummmmble')
	GOTO 27
	END
