      SUBROUTINE TIMEWRP
C*BEGIN COMMON 
      COMMON SNAP,SNAPSHT(247), 
     +   DATE,REMKL,REMCOM,REMBASE,REMRES,REMTIME,STARKL,BASEKL,
     +   KILLK,KILLC,GALAXY(8,8),CX(10),CY(10),BASEQX(5),BASEQY(5), 
     +   NEWSTUF(8,8),PLNETS(10,5),ISX,ISY,NSCREM,NROMKL,NROMREM,
     +   NSCKILL,NPLANKL,ISATB,BATX,BATY,THINGX,THINGY,
     +   QUAD(10,10),KX(20),KY(20),KPOWER(20),KDIST(20),KSTUF(20),  
     +   FUTURE(10),MESSAGE(5,10),
     +   INKLING,INBASE,INRESOR,INCOM,INTIME,INSTAR,INENRG,INSHLD,
     +   INTORPS,INLSR,INDATE,ENERGY,SHLD,SHLDUP,CONDIT,TORPS,SHIP, 
     +   QUADX,QUADY,SECTX,SECTY,WARPFAC,WFACSQ,LSUPRES,DAMAGE(20), 
     +   LENGTH,SKILL,PASSWD,DIST,DIREC,TIME,BASEX,BASEY,DOCKFAC, 
     +   KLHERE,COMHERE,CASUAL,NHELP,NKINKS,STARCH(8,8),
     +   DEVICE(2,14),IDIDIT,GAMEWON,ALIVE,JUSTIN,RESTING,ALLDONE,
     +   DAMFAC,SHLDCHG,NDEVICE,PLNETX,PLNETY,INORBIT,LANDED,IPLANET,
     +   IMINE,ICRYSTL,INPLAN,NENHERE,ISHERE,NEUTZ,IRHERE,ICRAFT,
     +   IENTESC,ISCRAFT,ISCATE,CRYPROB,ICITE,IPHWHO,
     +   CRACKS(12) 
      INTEGER SHLDUP,CONDIT,QUADX,QUADY,SECTX,SECTY,TORPS,
     +   REMKL,REMBASE,SKILL,REMCOM,GALAXY,STARCH,CX,CY, 
     +   SHIP,ALLDONE,BASEQX,BASEQY,BASEX,BASEY,GAMEWON, 
     +   ALIVE,STARKL,BASEKL,CASUAL,COMHERE,RESTING,SNAP,SHLDCHG, 
     +   THINGX,THINGY,BATX,BATY,PLNETX,PLNETY,PLNETS
      REAL KDIST,KPOWER,LSUPRES,INTIME,INRESOR,INDATE,INSHLD,   
     +   INENRG,INLSR 
	BYTE QUAD
	REAL*8 DEVICE,PASSWD
C*END COMMON 
      DIMENSION PICTURE(247)
      EQUIVALENCE (PICTURE,DATE)
      CALL PROUT(21H***TIME WARP ENTERED.,21)
      IF(SNAP.NE.0 .AND. RANF(0).LT.0.5) GO TO 10 
C--------TRAVEL FORWARD IN TIME 
      TIME=-0.5*INTIME*ALOG(RANF(0))
      CALL CRAM(35HYOU ARE TRAVELLING FORWARD IN TIME ) 
      CALL CRAMF(TIME,0,2)
      CALL CRAMDMP(11H STARDATES.)
C--------CHEAT TO MAKE SURE NO TRACTOR BEAMS OCCUR DURING TIME WARP 
      FUTURE(2)=FUTURE(2)+TIME
      GO TO 40
C--------TRAVEL BACKWARD IN TIME
 10   XDATE=DATE
      DATE=SNAPSHT(1) 
      CALL CRAM(36HYOU ARE TRAVELLING BACKWARD IN TIME )
      CALL CRAMF(XDATE-DATE,0,2)
      CALL CRAMDMP(11H STARDATES.)
      SNAP=0
      DO 20 L=2,247 
 20   PICTURE(L)=SNAPSHT(L) 
      FUTURE(3)=DATE+EXPRAN(0.5*INTIME) 
C--------REVERT STAR CHART TO EARLIER ERA.
      DO 30 L=1,8 
      DO 30 LL=1,8
 30   STARCH(L,LL)=MIN0(1,STARCH(L,LL)) 
      CALL PROUT( 
     +   57HSPOCK HAS RECONSTRUCTED A CORRECT STAR CHART FROM MEMORY.
	1 ,57)
C--------MODIFY DESTINATION QUADRANT TO CORRESPOND TO NEW TIME
 40   CALL NEWQUAD
      RETURN
      END 
