C***   GETWDS
       SUBROUTINE GETWDS

C  WHEN CALLED, CHECKS IF PREVIOUS WORDS VECTOR HAS BEEN EXHAUSTED.
C  IF NOT, BRANCH AROUND THE CODE WHICH READS IN A NEW LINE.  IF VECTOR IS EMPTY
C  SUCK UP A LINE FROM THE TTY, THEN CHECK EACH WORD FOR INTELLIGIBILITY.
C  IF THE WORD IS VALID, ITS NUMBER GETS STUCK INTO THE WORDS VECTOR.
C  THEN EACH WORD IS PARSED BY THE APPROPRIATE CODE.  THE LABELS BELOW ARE
C  100 TIMES THE WORD CLASS.
C
C  THE FOLLOWING VECTORS ARE USED:
C       TXT(WDX,2)              HOLD THE RAW TEXT FROM GETLIN
C       WORDS(WDX)              LIST OF WORD NUMBERS, CONVERTED FROM TXT(WDX,1).
C       VTXT(VRBX,2)            HOLD THE TEXT FOR VERB VRBX.
C       VERBS(VRBX)             IS THE LIST OF VALIDATED VERB NUMBERS.
C       OTXT(OBJX,2)            HOLDS THE TEXT OF THE OBJECT OBJX.
C       OBJX(OBJX)              IS THE LIST OF VALIDATED OBJECT NUMBERS.
C       IOTXT(IOBX,2)           HOLDS THE TEXT FOR PREP'S IOBJ.

       IMPLICIT INTEGER(A-Z)
       LOGICAL BLIND,LIVING,PCT,PFLAG,HINGED,AT,ATHAND,TOTING,K1,ISWIZ
      REAL*8 WORD1,WORD2,DKK,DK
      LOGICAL WIZARD

      COMMON/IZWIZ/ISWIZ
       COMMON /ADJCOM/ ADJKEY(50),ADJTAB(150),ADJSIZ
      DOUBLE PRECISION NTXT
       COMMON /ALLCOM/ NTXT(150,2)
       COMMON /DIECOM/ NUMDIE,MAXDIE,TURNS
       COMMON /DWFCOM/ DWARF,KNIFE,KNFLOC,DFLAG,DSEEN(6),DLOC(6),
     1  ODLOC(6),DWFMAX
       COMMON /LIQCOM/ BOTTLE,CASK,WATER,OIL,WINE,LIQTYP(5)
       COMMON /LOCCOM/ LOC,OLDLOC,OLDLC2,NEWLOC,MAXLOC
       COMMON /MNECOM/ BACK,CAVE,DPRSSN,ENTRNC,EXIT,GO,LOOK,NULL,
     1 AXE,BEAR,BOAT,BOOK,BOOK2,BOOTH,CARVNG,CHASM,CHASM2,DOOR,GNOME,
     2 GRATE,LAMP,PDOOR,PLANT,PLANT2,ROCKS,ROD,ROD2,SAFE,
     3 TDOOR,TDOOR2,TROLL,TROLL2,EMRALD,SPICES,
     4 FIND,YELL,INVENT,LEAVE,POUR,SAY,TAKE,THROW,
     5 KILLED,IWEST,PHUCE(2,4),TK(20)
       COMMON /PLACOM/ ATLOC(250),LINK(300),PLACE(150),
     1          FIXED(150),MAXOBJ
      INTEGER*4 PTAB
       COMMON /PRPCOM/ VKEY(60),PTAB(300),VKYSIZ,PTBSIZ
      REAL*8 TXT
       COMMON /UTXCOM/ TXT(35,2),WDX
      REAL*8 VTXT,OTXT,IOTXT
       COMMON /WRDCOM/ VERBS(45),VTXT(45,2),VRBX,OBJS(45),OTXT(45,2),
     1  OBJX,IOBJS(15),IOTXT(15,2),IOBX,PREP,WORDS(45)
       DIMENSION TAKDIR(20)

C            MOTION  NOUN  ACTION  MISC   PREP   ADJ    CONJ
       DATA CLASSD,CLASSN,CLASSA,CLASSM,CLASSP,CLASSJ,CLASSC
     1 /1,2,3,4,5,6,7/
C
C  A FEW MORE ACTION VERBS NOT IN COMMON.
       DATA DROP,FEED,NOTHNG,LIGHT,DRINK,SCORE /02,21,05,07,15,24/
       DATA POUR,PICK,PUT,GET /13,41,42,44/
C
C  AND A MOTION VERB:
       DATA ENTER /3/
C
C  AND TO GET/DROP EVERYTHING IN SIGHT:
       DATA ALL /109/
C
C  TAKDIR IS A LIST OF MOTION VERBS WHICH ARE ACCEPTABLE AFTER 'TAKE'.
       DATA TAKDIR/2,6,9,10,11,13,14,17,23,25,33,34,
     1                  36,37,39,78,79,80,89,-1/
C
C  IF WORDS(WDX+1) HAS SOMETHING IN IT, WE ARE STILL PROCESSING OLD INPUT LINE.
C  IF WORDS(1) = -2, SOMEONE ELSE HAS CALLED GETLIN (E.G., KILL DRAGON).

       IF(WORDS(WDX+1).GT.0)GOTO 30

C  IF WORDS(1) HAS BEEN SET TO -2, SOMEONE ELSE HAS ALREADY READ IN
C  THE NEW LINE, PRESUMABLY TO CHECK FOR SOME NON-STANDARD WORD.
C  (THIS HAPPENS WHEN KILLING DRAGON WITH BARE HANDS.)
20      IF(WORDS(1).NE.-2)CALL GETLIN
       WDX=0
       DO 25 I=1,35
       WORDS(I)=0
       IF(TXT(I,1).NE.'        ')WORDS(I)=VOCABX(TXT(I,1),-1)
25      CONTINUE

C  THE FIRST WORD OF EACH CLAUSE GETS SPECIAL CHECKING, MOSTLY LOOKING
C  FOR IDIOMS.

C  SPECIAL HANDLING FOR 'SAY' AND 'CALL'.  WIN IF SAYING/CALLING
C  MAGIC WORDS.  NARKY IF UTTERING ANYTHING ELSE.  IF NO OBJ, PASS
C  ON FOR HIGHER LEVEL PARSING.
30      PFLAG=.FALSE.
       WDX=WDX+1
       WORD=WORDS(WDX)
       IF(WORD)830,800,32

32      KK=CLASS(WORD)
       IF(KK.EQ.-1)GOTO 91
       IF(KK.EQ.CLASSA.OR.KK.EQ.CLASSD.OR.KK.EQ.CLASSM)CALL CLRLIN
       K=VAL(WORD)
       IF(KK.NE.CLASSA.OR.(K.NE.SAY.AND.K.NE.YELL))GOTO 40

C  'SAY' OR 'CALL'.  IF NO NEXT WORD, PASS ON TO HIGHER POWERS.
C  IF OBJECT IS MAGIC WORD ('SAY XYZZY'), FLUSH 'SAY' & TAKE NEXT WORD.
       IF(WORDS(WDX+1).EQ.0.OR.CLASS(WORDS(WDX+1)).EQ.CLASSC)GOTO 99
       WDX=WDX+1
       IF(K.EQ.SAY)CALL A5TOA1(TXT(WDX,1),TXT(WDX,2),'".',TK,K)
       IF(K.EQ.YELL)CALL A5TOA1(TXT(WDX,1),TXT(WDX,2),'"!!!!!',TK,K)
       WORD=WORDS(WDX)
       IF(WORD.EQ.62.OR.WORD.EQ.65.OR.WORD.EQ.71.OR.WORD.EQ.82
     1  .OR.WORD.EQ.2025)GOTO 99
       PRINT 37,(TK(I),I=1,K)
37      FORMAT(/' Okay, "',20A1)
       GOTO 860

C  SPECIAL STUFF FOR 'ENTER'.  CAN'T GO INTO WATER.
C  'ENTER BOAT' MEANS 'TAKE BOAT'.
40      WORD1=TXT(WDX,1)
       WORD2=TXT(WDX+1,1)
       IF(WORD1.NE.'ENTER   ')GOTO 50
       IF(WORD2.EQ.'        ')GOTO 91
       SPK=43
       IF(LIQLOC(LOC).EQ.WATER)SPK=70
       IF(WORD2.EQ.'STREAM  '.OR.WORD2.EQ.'WATER   '.OR.WORD2.EQ.
     1  'RESERV  '.OR.WORD2.EQ.'OCEAN   '.OR.WORD2.EQ.'SEA     '
     2  .OR.WORD2.EQ.'POOL    ')GOTO 810
       IF(WORD2.NE.'BOAT    '.AND.WORD2.NE.'ROWBOA  ')GOTO 99
       WORD=TAKE+2000
       GOTO 99

C  'LEAVE' IS A MOTION VERB, UNLESS LEAVING AN OBJECT,
C  E.G., 'LEAVE BOAT' OR 'LEAVE BOTTLE'.  BUT MAKE SURE TO LEAVE ('DROP')
C  ONLY TOTABLE OBJECTS.
50      KK=WORDS(WDX+1)
       IF(WORD1.NE.'LEAVE   '.OR.CLASS(KK).NE.CLASSN)
     1  GOTO 55
       IF(HINGED(VAL(KK)).OR.FIXED(VAL(KK)).NE.0)GOTO 99
       WORD=LEAVE+2000
       GOTO 99

C  IF 'LIGHT LAMP', LIGHT MUST BE TAKEN AS AN ACTION VERB, NOT A NOUN.
55      IF(WORD1.NE.'LIGHT'.OR.WORDS(WDX+1).NE.(LAMP+1000))GOTO 60
       WORD=LIGHT+2000
       GOTO 99

C  'WATER PLANT' BECOMES 'POUR WATER', IF WE ARE AT PLANT.
C  'OIL DOOR' BECOMES 'POUR OIL', ETC., ETC.
60      IF((WORD1.NE.'WATER   '.AND.WORD1.NE.'OIL     ')
     1  .OR.(WORD2.NE.'PLANT   '.AND.WORD2.NE.'DOOR    '
     2     .AND.WORD2.NE.'SWORD   '.AND.WORD2.NE.'ANVIL   '))GOTO 65
       IF(.NOT.AT(VOCABX(WORD2,CLASSN)))GOTO 61
       WORDS(WDX+1)=WORDS(WDX)
       TXT(WDX+1,1)=WORD1
       TXT(WDX+1,2)=TXT(WDX,2)
61      WORD=POUR+2000
       GOTO 99

C  CHECK FILLING OR EMPTYING A CONTAINER.
65      IF((WORD1.NE.'EMPTY   ').OR.
     1  (CLASS(WORDS(WDX+1)).NE.CLASSN))GOTO 91
       KK=VAL(WORDS(WDX+1))
       IF(KK.NE.SACK.AND.KK.NE.SAFE.AND.KK.NE.BOAT.AND.KK.NE.CHEST)
     1  GOTO 91
       GOTO 91
C  *** UNFINISHED CODE HERE ***


C  THIS IS THE 'INNER' LOOP.  DISPATCHING OF ALL WORDS IN A CLAUSE AFTER
C  THE FIRST COMES THRU HERE.

90      WDX=WDX+1
       WORD=WORDS(WDX)
91      IF(WORD)830,900,92

96      WCLASS=WCLASS+1
       WORD=VOCABX(TXT(WDX,1),-(WCLASS+1))
       IF(WORD.EQ.-1)GOTO 800
       WORDS(WDX)=WORD
92      IF(CLASS(WORD).NE.CLASSN)GOTO 99

C  IT'S NOT THE FIRST: MAKE SURE HE INCLUDED A COMMA OR 'AND'.
C  DIFFERENTIATE BETWEEN DIR & INDIR OBJECTS.
C  CHECK FOR SPECIAL CASE OF MULTIPLE OBJECTS: 'FEED BEAR HONEY' OR
C  'THROW TROLL NUGGET'.
       K=OBJX
       IF(PFLAG)K=IOBX
       IF(K.EQ.0.OR.CLASS(WORDS(WDX-1)).EQ.CLASSC)GOTO 99
       KK=VAL(VERBS(VRBX))
       IF(.NOT.LIVING(OBJS(OBJX)).OR.(KK.NE.THROW.AND.KK.NE.FEED))
     1  GOTO 800
       IOBX=IOBX+1
       IOBJS(IOBX)=OBJS(OBJX)
       OBJS(OBJX)=0
       OBJX=OBJX-1

99      WCLASS=CLASS(WORD)
       GOTO(100,200,300,400,500,600,700),WCLASS
C            MWD OBJ AVB MVB PRP ADJ CNJ
       CALL BUG(33)
C  MOTION VERB.
C  A MOTION VERB IS EITHER A DIRECTION ('WEST') OR A MOTION ('JUMP').
C  MULTIPLE MOTIONS MUST BE SEPARATED BY COMMAS OR AND'S.  THERE ARE
C  SOME IDIOMATIC USES WHICH MUST BE SCANNED FOR, SUCH AS 'TAKE BRIDGE',
C  WHICH BECOMES 'BRIDGE' AND 'GO WEST', WHICH BECOMES 'WEST', AND 'LEAVE THING'
C  IS DIFFERENT FROM JUST 'LEAVE'.
C
C  IF ORIGINAL VERB WAS 'GO', FLUSH IT & REPLACE WITH THIS ONE.
C  I.E., 'GO WEST' BECOMES 'WEST'.
C
C  CHECK TAKDIR(20) LIST FOR VALID OBJECT MOTION VERBS FOR 'TAKE'.
C  IF FOUND, THROW AWAY 'TAKE' AND USE THE MOTION VERB.
C
C  SINCE THE ORIGINAL VERB IS AN ACTION VERB, CHECK THIS WORD IN THE
C  NOUN TABLE.  MAYBE IT IS AN OBJECT SYNONYMOUS WITH A VERB ('ROCKS').
C
C  IF IT ISN'T A VALID MOTION-OBJECT OF 'TAKE' OR 'GO', NOR AN OBJECT,
C  CHECK THE PREP TABLE.  IF FOUND, HAND IT TO THE PREPOSITION ANALYZER.

100     IF(VRBX.EQ.0)GOTO 180
       K=VERBS(VRBX)
       IF(CLASS(K).GT.CLASSA)GOTO 800
       IF(CLASS(K).NE.CLASSA)GOTO 140
       IF(VAL(K).EQ.GO)GOTO 180

       IF(VAL(K).NE.TAKE)GOTO 96
       KK=VAL(WORD)
       DO 110 I=1,20
       IF(TAKDIR(I).EQ.KK)GOTO 180
110     CONTINUE
       GOTO 96

C  IF ORIGINAL MOTION VERB WAS CRAWL, JUMP OR CLIMB, IGNORE CURRENT WORD.
C  I.E., 'CLIMB UP' OR 'JUMP OVER' BECOME 'CLIMB' & 'JUMP' ONLY.
140     IF(K.EQ.17.OR.K.EQ.39.OR.K.EQ.56)GOTO 90
C            'CRAWL'     'JUMP'    'CLIMB'

180     VERBS(1)=WORD
       VRBX=1
       IF(TXT(WDX,1).NE.'WEST    ')GOTO 90
       IWEST=IWEST+1
       IF(IWEST.EQ.10)CALL RSPEAK(17)
       K=VAL(WORD)
       IF(K.EQ.EXIT.OR.K.EQ.ENTER)GOTO 860
       GOTO 90
C  ANALYZE OBJECT.
C  IF PFLAG IS TRUE, THEN WE ARE PROCESSING A SET OF INDIRECT (PREP)
C  OBJECTS, NOT DIRECT OBJS.

200     IF(PFLAG)GOTO 503
       IF(VRBX.NE.0)GOTO 220
       K=VOCABX(TXT(WDX,1),-(CLASSA+1))
       IF(K.EQ.-1)GOTO 220
       WORD=K
       GOTO 300

220     WORD=VAL(WORD)
       IF(WORD.EQ.ALL)GOTO 280
222     CALL GETOBJ(WORD)
       IF(WORD)230,860,240

C  IT WASN'T REALLY AN OBJECT.  GO SEE WHAT IT WAS.
230     WORD=-WORD
       GOTO 99

C  IT WAS REALLY AN OBJECT & IT IS HERE.
240     OBJX=OBJX+1
       OBJS(OBJX)=WORD
       OTXT(OBJX,1)=TXT(WDX,1)
       OTXT(OBJX,2)=TXT(WDX,2)
       GOTO 90

C  TAKE EVERYTHING NOT BATTENED DOWN.

280     KK=VAL(VERBS(VRBX))
       K1=.FALSE.
       IF(KK.EQ.DROP.OR.KK.EQ.PUT.OR.KK.EQ.LEAVE)GOTO 281
       K1=.TRUE.
       IF(KK.NE.TAKE.AND.KK.NE.PICK.AND.KK.NE.GET)GOTO 800
       SPK=357
       IF(BLIND(0))GOTO 810
281     DO 289 I=1,MAXOBJ
       IF(.NOT.ATHAND(I).OR.FIXED(I).NE.0)GOTO 289
       IF(I.GE.WATER.AND.I.LE.WINE+1)GOTO 289
       IF((K1.AND.TOTING(I)) .OR. (.NOT.K1.AND..NOT.TOTING(I)) )GOTO 289
       OBJX=OBJX+1
       OBJS(OBJX)=I
       OTXT(OBJX,1)=NTXT(I,1)
       OTXT(OBJX,2)=NTXT(I,2)
       IF(OBJX.EQ.44)GOTO 90
289     CONTINUE
       GOTO 90
C  ACTION VERB.
300     IF(VRBX.EQ.0)GOTO 370
       IF(VAL(VERBS(VRBX)).NE.TAKE)GOTO 320
       K=VAL(WORD)
       IF(K.EQ.DRINK.OR.K.EQ.INVENT.OR.K.EQ.SCORE.OR.K.EQ.NOTHNG
     1  .OR.K.EQ.LOOK)GOTO 371
       IF(K.NE.GO)GOTO 800
       DK=TXT(WDX,1)
       IF(DK.EQ.'WALK    '.OR.DK.EQ.'RUN     '.OR.DK.EQ.'HIKE    ')
     1  GOTO 371
       GOTO 800

320     IF(OBJX.NE.0.OR.CLASS(WORDS(WDX-1)).NE.CLASSC)GOTO 800
370     VRBX=VRBX+1
371     VERBS(VRBX)=WORD
       VTXT(VRBX,1)=TXT(WDX,1)
       VTXT(VRBX,2)=TXT(WDX,2)
       GOTO 90


C  MISCELLANEOUS WORDS/VERBS.
400     IF(VRBX.NE.0)GOTO 800
       VERBS(1)=WORD
       VRBX=1
       GOTO 90
C  ANALYZE A PREPOSITION AND ITS OBJECT.  CHECK THAT PREP
C  IS VALID FOR THIS VERB, AND THEN CHECK THAT THE OBJECT IS VALID
C  FOR THIS PREPOSITION.  IF FIRST CHECK FAILS, SYNTAX IS MESSED
C  UP; IF SECOND PART FAILS, IT MAY MERELY BE AN IMPOSSIBLE ACT.

500     IF(CLASS(VERBS(VRBX)).NE.CLASSA.OR.IOBX.NE.0)GOTO 800
       IF(PFLAG)GOTO 503
       VRBKEY=VKEY(VAL(VERBS(VRBX)))
       IF(VRBKEY.EQ.0)GOTO 800
       PREP=VAL(WORD)
       PFLAG=.TRUE.
       WDX=WDX+1
       WORD=WORDS(WDX)
       IF(WORD.EQ.0)GOTO 510
       GOTO(800,503,800,800,800,600,510),CLASS(WORD)
       GOTO 840

503     WORD=VAL(WORD)
       IF(WORD.EQ.ALL)GOTO 510
504     CALL GETOBJ(WORD)
       IF(WORD)570,860,505

505     IOBX=IOBX+1
       IOBJS(IOBX)=WORD
       IOTXT(IOBX,1)=TXT(WDX,1)
       IOTXT(IOBX,2)=TXT(WDX,2)
510     KK=IABS(PTAB(VRBKEY)/1000)
       IF(KK.NE.PREP)GOTO 525

C  PREP IS VALID WITH THIS VERB.  NOW CHECK OBJECT OF PREP.
       IF(WORD.EQ.0.OR.CLASS(WORD).EQ.CLASSC)GOTO 530

C  AN OBJ FOLLOWS THE PREP.  SEE IF IT'S PLAUSIBLE.
520   KK=IABS(INTS(MOD(PTAB(VRBKEY),0001000)))
       IF(KK.EQ.WORD.AND.KK.EQ.ALL)GOTO 280
       IF(KK.EQ.WORD.OR.KK.EQ.999)GOTO 90
525     VRBKEY=VRBKEY+1
       IF(PTAB(VRBKEY-1).GE.0)GOTO 510
       GOTO 570

C  NO OBJ FOLLOWS PREP.  CHECK SPECIAL CASES.
530     PFLAG=.FALSE.
       WDX=WDX-1
       DK=TXT(WDX,1)
       DKK=VTXT(VRBX,1)
       IF((DK.NE.'ON      '.AND.DK.NE.'OFF     ').AND.
     1 (DKK.NE.'TURN    '.OR.OBJS(OBJX).NE.LAMP) .AND.
     2 (DKK.NE.'TAKE    '.AND.DKK.NE.'PUT     ') )GOTO 570
       IF((DK.EQ.'UP      '.AND.DKK.NE.'PICK    ').OR.
     1 (DK.EQ.'DOWN    '.AND.(DKK.NE.'PUT     '.AND.VERBS(VRBX).NE.THROW
     2 )))GOTO 570
       WDX=WDX+1
       WORD=WORDS(WDX)
       IF(WORD.EQ.0)GOTO 900
       IF(CLASS(WORD).NE.CLASSC)GOTO 800
       GOTO 91

C  YOU CAN'T DO THAT!!
570     SPK=NOWAY(0)
       GOTO 810
C  ADJECTIVE HANDLER.
C  SCARF THE NEXT WORD, MAKE SURE IT IS A VALID OBJECT FOR THIS ADJ.
C  THEN CALL GETOBJ TO SEE IF IT IS REALLY THERE, THEN LINK INTO OBJ
C  CODE.

600     ADJ=VAL(WORD)
       WDX=WDX+1
       WORD=WORDS(WDX)
       IF(WORD)840,640,605

605     IF(CLASS(WORD).EQ.CLASSC) GOTO 640
       IF(CLASS(WORD).NE.CLASSN) WORD=VOCABX(TXT(WDX,1),-(CLASSN+1))
       IF(WORD.EQ.-1.OR.CLASS(WORD).NE.CLASSN.OR.VAL(WORD).EQ.ALL)
     1  GOTO 800
       WORDS(WDX)=WORD
       KK=VAL(WORD)
       K=ADJKEY(ADJ)
610     IF(KK.EQ.IABS(ADJTAB(K)))GOTO 92
       IF(ADJTAB(K).LT.0)GOTO 800
       K=K+1
       GOTO 610

640     CALL A5TOA1(TXT(WDX-1,1),TXT(WDX-1,2),'WHAT?',TK,K)
       PRINT 642,(TK(I),I=1,K)
642     FORMAT(/1H , 20A1)
       GOTO 20


C  ANALYZE A CONJUNCTION.  MAY BE A COMMA OR AN EXPLICIT "AND".
C  LOOK AHEAD AT NEXT WORD.  IF IT IS AN ACTION VERB AND NO OBJECT
C  HAS YET BEEN SPECIFIED, PUT IT INTO THE VERB STACK.  IF IT IS
C  AN OBJECT, ADD IT TO THE PILE.
C  ELSE, BUMP BACK THE WORD POINTER, ASSUME END OF CLAUSE, AND
C  RETURN.
700     WDX=WDX+1
       WORD=WORDS(WDX)
       IF(WORD)840,800,710

710     GOTO(790,92,720,790,800,92,800),CLASS(WORD)

C  A NEW ACTION VERB FOLLOWS.  IF NO PREVIOUS VERB HAS BEEN TYPED,
C  HE LOSES.  IF PREVIOUS VERB IS NOT AN ACTION VERB, HE LOSES.
C  IF AN OBJ/IOBJ WAS SPECIFIED FOR PREV ACT VERB, HE LOSES.  ONLY
C  VALID SYNTAX IS: 'GET AND OPEN CAGE'.
720     IF(VRBX.NE.0.AND.CLASS(VERBS(VRBX)).EQ.CLASSA
     1  .AND.OBJX.EQ.0.AND.IOBX.EQ.0)GOTO 92
790     WDX=WDX-1
       GOTO 900
C  GEE, I DON'T UNDERSTAND.  FLUSH REST OF CURRENT CLAUSE, UP TO
C  EOL OR CONJUNCTION & CONTINUE.
800     SPK=CONFUZ(0)
810     CALL RSPEAK(SPK)
820     CALL CLRLIN
       GOTO 20

C  AN IRREGULAR WORD WAS TYPED IN BY USER.  CHECK FOR WIZARDRY.
830     IF(TURNS.NE.0.OR.TXT(1,1).NE.'MAGIC'.OR.TXT(2,1).NE.'MODE')
     1  GOTO 840
       TXT(1,1)=' '
       TXT(2,1)=' '
       CALL MAINT
C       (NO RETURN FROM MAINT)

840   IF(TXT(1,1).NE.'WIZARD'.OR.TXT(2,1).NE.'MODE    ')GOTO 841
      IF(.NOT.WIZARD(.FALSE.))GOTO 843
      ISWIZ=.TRUE.
      CALL BREAK$(.FALSE.)
843   CALL CLRLIN
      GOTO 20
841     IF(PCT(25))GOTO 850
       CALL A5TOA1(TXT(WDX,1),TXT(WDX,2),'.',TK,K)
       PRINT 842,(TK(I),I=1,K)
842     FORMAT(/' I don''t understand the word ',20A1)
       CALL CLRLIN
       GOTO 20

850     CALL A5TOA1(TXT(WDX,1),TXT(WDX,2),'?',TK,K)
       PRINT 852,(TK(I),I=1,K)
852     FORMAT(/' Mumble?  ',20A1)
       CALL CLRLIN
       GOTO 20


C  SCAN TO CONJ OR END OF LINE.
860     CALL CLRLIN
       PFLAG=.FALSE.
862     WDX=WDX+1
       IF(WORDS(WDX).EQ.0)GOTO 20
       IF(CLASS(WORDS(WDX)).EQ.CLASSC)GOTO 90
       GOTO 862

C  END OF CLAUSE.  WE APPEAR TO HAVE REACHED THE END OF A SENTENCE.
C  IT WAS TERMINATED EITHER BY CRLF OR A CONJUNCTION.  IF A CONJ,
C  THE CONJ ANALYZER CLAIMS  THAT THE NEXT WORDS ARE NOT PART OF
C  THIS CLAUSE.  DECIDE WHETHER OR NOT WE HAVE ENOUGH TO WORK WITH.
900     PFLAG=.FALSE.
       IF(VERBS(1).NE.0)GOTO 930
       IF(OBJS(1).EQ.0)GOTO 800
       IF(OBJS(2).NE.0)GOTO 920
       CALL A5TOA1(OTXT(1,1),OTXT(1,2),'?',TK,K)
       PRINT 915,(TK(I),I=1,K)
915     FORMAT(/' What do you want to do with the ',20A1)
       GOTO 20

920     CALL A5TOA1('them',' ','?',TK,K)
       PRINT 926,(TK(I),I=1,K)
926     FORMAT(/' What do you want to do with ',20A1)
       GOTO 20

930     IF(OBJX.GT.1.AND.IOBX.GT.1)GOTO 800
       RETURN

       END
