1
2
3
4
5
6
7
8
9 GDT
10 IMPLICIT INTEGER (A-Z)
11 %include dparam
12 PARAMETER (DBGMAX=38) debug
13 CHARACTER*2 CMD,DBGCMD(DBGMAX),DBGSML(DBGMAX)
14 INTEGER ARGTYP(DBGMAX)
15 LOGICAL VALID1,VALID2,VALID3
16
17
18
19 INTEGER EQR(RMAX,5)
20 EQUIVALENCE (EQR(1,1),RDESC1(1))
21 INTEGER EQO(OMAX,14)
22 EQUIVALENCE (EQO(1,1),ODESC1(1))
23 INTEGER EQC(CMAX,2)
24 EQUIVALENCE (EQC(1,1),CTICK(1))
25 INTEGER EQV(VMAX,5)
26 EQUIVALENCE (EQV(1,1),VILLNS(1))
27 INTEGER EQA(AMAX,7)
28 EQUIVALENCE (EQA(1,1),AROOM(1))
29
30
31
32 VALID1(A1,L1)=(A1.GT.0).AND.(A1.LE.L1)
33 VALID2(A1,A2,L1)=VALID1(A1,L1).AND.VALID1(A2,L1).AND.
34 & (A1.LE.A2)
35 VALID3(A1,L1,A2,L2)=VALID1(A1,L1).AND.VALID1(A2,L2)
36 DATA DBGCMD/'DR','DO','DA','DC','DX','DH','DL','DV','DF','DS',
37 & 'AF','HE','NR','NT','NC','ND','RR','RT','RC','RD',
38 & 'TK','EX','AR','AO','AA','AC','AX','AV','D2','DN',
39 & 'AN','DM','DT','AH','DP','PD','DZ','AZ'/
40 DATA DBGSML/'dr','do','da','dc','dx','dh','dl','dv','df','ds',
41 & 'af','he','nr','nt','nc','nd','rr','rt','rc','rd',
42 & 'tk','ex','ar','ao','aa','ac','ax','av','d2','dn',
43 & 'an','dm','dt','ah','dp','pd','dz','az'/
44 DATA ARGTYP/ 2 , 2 , 2 , 2 , 2 , 0 , 0 , 2 , 2 , 0 ,
45 & 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
46 & 1 , 0 , 3 , 3 , 3 , 3 , 1 , 3 , 2 , 2 ,
47 & 1 , 2 , 1 , 0 , 0 , 0 , 0 , 1 /
48
49
50
51
52
53 IF(GDTFLG.NE.0) GO TO 2000
54 WRITE(OUTCH,100)
55 RETURN
56
57 100 FORMAT(' You are not an authorized user.')
58
59
60
61
62
63 2000 WRITE(OUTCH,200)
64 READ(INPCH,210,ERR=2200,END=31000) CMD
65 IF(CMD.EQ.' ') GO TO 2000
66 DO 2100 I=1,DBGMAX
67 IF((CMD.EQ.DBGCMD(I)).OR.(CMD.EQ.DBGSML(I))) GO TO 2300
68 2100 CONTINUE
69 2200 WRITE(OUTCH,220)
70 GO TO 2000
71
72 200 FORMAT(' GDT> ',$)
73 210 FORMAT(A2)
74 220 FORMAT(' ?')
75 230 FORMAT(2I6)
76 240 FORMAT(I6)
77 225 FORMAT(' Limits: ',$)
78 235 FORMAT(' Entry: ',$)
79 245 FORMAT(' Idx,Ary: ',$)
80
81 2300 GO TO (2400,2500,2600,2700),ARGTYP(I)+1
82 GO TO 2200
83
84 2700 WRITE(OUTCH,245)
85 READ(INPCH,230,ERR=2200,END=2000) J,K
86 GO TO 2400
87
88 2600 WRITE(OUTCH,225)
89 READ(INPCH,230,ERR=2200,END=2000) J,K
90 IF(K.EQ.0) K=J
91 GO TO 2400
92
93 2500 WRITE(OUTCH,235)
94 READ(INPCH,240,ERR=2200,END=2000) J
95 2400 GO TO (10000,11000,12000,13000,14000,15000,16000,17000,18000,
96 & 19000,20000,21000,22000,23000,24000,25000,26000,27000,28000,
97 & 29000,30000,31000,32000,33000,34000,35000,36000,37000,38000,
98 & 39000,40000,41000,42000,43000,44000,45000,46000,47000),I
99 GO TO 2200
100
101
102
103
104
105 10000 IF(.NOT.VALID2(J,K,RLNT)) GO TO 2200
106 WRITE(OUTCH,300)
107 DO 10100 I=J,K
108 WRITE(OUTCH,310) I,(EQR(I,L),L=1,5)
109 10100 CONTINUE
110 GO TO 2000
111
112 300 FORMAT(' RM# DESC1 EXITS ACTION VALUE FLAGS')
113 310 FORMAT(1X,I3,4(1X,I6),1X,O6)
114
115
116
117 11000 IF(.NOT.VALID2(J,K,OLNT)) GO TO 2200
118 WRITE(OUTCH,320)
119 DO 11100 I=J,K
120 WRITE(OUTCH,330) I,(EQO(I,L),L=1,14)
121 11100 CONTINUE
122 GO TO 2000
123
124 320 FORMAT(' OB# DESC1 DESC2 DESCO ACT FLAGS1 FLAGS2 FV TV',
125 & ' SIZE CAPAC ROOM ADV CON READ')
126 330 FORMAT(1X,I3,3I6,I4,2O7,2I3,2I6,I6,2I4,I6)
127
128
129
130 12000 IF(.NOT.VALID2(J,K,ALNT)) GO TO 2200
131 WRITE(OUTCH,340)
132 DO 12100 I=J,K
133 WRITE(OUTCH,350) I,(EQA(I,L),L=1,7)
134 12100 CONTINUE
135 GO TO 2000
136
137 340 FORMAT(' AD# ROOM SCORE VEHIC OBJECT ACTION STREN FLAGS')
138 350 FORMAT(1X,I3,6(1X,I6),1X,O6)
139
140
141
142 13000 IF(.NOT.VALID2(J,K,CLNT)) GO TO 2200
143 WRITE(OUTCH,360)
144 DO 13100 I=J,K
145 WRITE(OUTCH,370) I,(EQC(I,L),L=1,2),CFLAG(I),CCNCEL(I)
146 13100 CONTINUE
147 GO TO 2000
148
149 360 FORMAT(' CL# TICK ACTION FLAG CANCEL')
150 370 FORMAT(1X,I3,1X,I6,1X,I6,5X,L1,5X,L1)
151
152
153
154 14000 IF(.NOT.VALID2(J,K,XLNT)) GO TO 2200
155 WRITE(OUTCH,380)
156 DO 14100 I=J,K,10
157 L=MIN0(I+9,K)
158 WRITE(OUTCH,390) I,L
159 DO 14050 L1=I,L
160 IF(TRAVEL(L1).GE.0) WRITE(OUTCH,391) TRAVEL(L1)
161 IF(TRAVEL(L1).LT.0) WRITE(OUTCH,392) TRAVEL(L1)
162 14050 CONTINUE
163 WRITE(OUTCH,393)
164 14100 CONTINUE
165 GO TO 2000
166
167 380 FORMAT(' RANGE CONTENTS')
168 390 FORMAT(1X,I4,'-',I4,1X,$)
169 391 FORMAT('+',O7,$)
170 392 FORMAT('+',I7,$)
171 393 FORMAT('+')
172
173
174
175 15000 WRITE(OUTCH,400) THFPOS,THFFLG,THFACT,SWDACT,SWDSTA
176 GO TO 2000
177
178 400 FORMAT(' THFPOS=',I6,', THFFLG=',L2,', THFACT=',L2/
179 &' SWDACT=',L2,', SWDSTA=',I2)
180
181
182
183 16000 WRITE(OUTCH,410) RLNT,XLNT,OLNT,CLNT,VLNT,ALNT,MLNT,R2LNT,
184 & MBASE,STRBIT
185 GO TO 2000
186
187 410 FORMAT(' R=',I6,', X=',I6,', O=',I6,', C=',I6/
188 &' V=',I6,', A=',I6,', M=',I6,', R2=',I5/
189 &' MBASE=',I6,', STRBIT=',I6)
190
191
192
193 17000 IF(.NOT.VALID2(J,K,VLNT)) GO TO 2200
194 WRITE(OUTCH,420)
195 DO 17100 I=J,K
196 WRITE(OUTCH,430) I,(EQV(I,L),L=1,5)
197 17100 CONTINUE
198 GO TO 2000
199
200 420 FORMAT(' VL# OBJECT PROB OPPS BEST MELEE')
201 430 FORMAT(1X,I3,5(1X,I6))
202
203
204
205 18000 IF(.NOT.VALID2(J,K,FMAX)) GO TO 2200
206 DO 18100 I=J,K
207 WRITE(OUTCH,440) I,FLAGS(I)
208 18100 CONTINUE
209 GO TO 2000
210
211 440 FORMAT(' Flag #',I2,' = ',L1)
212
213
214
215 19000 WRITE(OUTCH,450) PRSA,PRSO,PRSI,PRSWON,PRSCON
216 WRITE(OUTCH,460) WINNER,HERE,TELFLG
217 WRITE(OUTCH,470) MOVES,DEATHS,RWSCOR,MXSCOR,MXLOAD,LTSHFT,BLOC,
218 & MUNGRM,HS,EGSCOR,EGMXSC
219 WRITE(OUTCH,475) FROMDR,SCOLRM,SCOLAC
220 GO TO 2000
221
222 450 FORMAT(' Parse vector=',3(1X,I6),1X,L6,1X,I6)
223 460 FORMAT(' Play vector= ',2(1X,I6),1X,L6)
224 470 FORMAT(' State vector=',7(1X,I6)/14X,4(1X,I6))
225 475 FORMAT(' Scol vector= ',1X,O6,2(1X,I6))
226
227
228
229
230
231 20000 IF(.NOT.VALID1(J,FMAX)) GO TO 2200
232 WRITE(OUTCH,480) FLAGS(J)
233 READ(INPCH,490,ERR=2200,END=2000) FLAGS(J)
234 GO TO 2000
235
236 480 FORMAT(' Old=',L2,6X,'New= ',$)
237 490 FORMAT(L1)
238
239
240
241 21000 WRITE(OUTCH,900)
242 GO TO 2000
243
244 900 FORMAT(' Valid commands are:'/' AA- Alter ADVS'/
245 &' AC- Alter CEVENT'/' AF- Alter FINDEX'/' AH- Alter HERE'/
246 &' AN- Alter switches'/' AO- Alter OBJCTS'/' AR- Alter ROOMS'/
247 &' AV- Alter VILLS'/' AX- Alter EXITS'/
248 &' AZ- Alter PUZZLE'/' DA- Display ADVS'/
249 &' DC- Display CEVENT'/' DF- Display FINDEX'/' DH- Display HACKS'/
250 &' DL- Display lengths'/' DM- Display RTEXT'/
251 &' DN- Display switches'/
252 &' DO- Display OBJCTS'/' DP- Display parser'/
253 &' DR- Display ROOMS'/' DS- Display state'/' DT- Display text'/
254 &' DV- Display VILLS'/' DX- Display EXITS'/' DZ- Display PUZZLE'/
255 &' D2- Display ROOM2'/' EX- Exit'/' HE- Type this message'/
256 &' NC- No cyclops'/' ND- No deaths'/' NR- No robber'/
257 &' NT- No troll'/' PD- Program detail'/
258 &' RC- Restore cyclops'/' RD- Restore deaths'/
259 &' RR- Restore robber'/' RT- Restore troll'/' TK- Take.')
260
261
262
263 22000 THFFLG=.FALSE.
264 THFACT=.FALSE.
265 CALL NEWSTA(THIEF,0,0,0,0)
266 WRITE(OUTCH,500)
267 GO TO 2000
268
269 500 FORMAT(' No robber.')
270
271
272
273 23000 TROLLF=.TRUE.
274 CALL NEWSTA(TROLL,0,0,0,0)
275 WRITE(OUTCH,510)
276 GO TO 2000
277
278 510 FORMAT(' No troll.')
279
280
281
282 24000 CYCLOF=.TRUE.
283 CALL NEWSTA(CYCLO,0,0,0,0)
284 WRITE(OUTCH,520)
285 GO TO 2000
286
287 520 FORMAT(' No cyclops.')
288
289
290
291 25000 DBGFLG=1
292 WRITE(OUTCH,530)
293 GO TO 2000
294
295 530 FORMAT(' No deaths.')
296
297
298
299 26000 THFACT=.TRUE.
300 WRITE(OUTCH,540)
301 GO TO 2000
302
303 540 FORMAT(' Restored robber.')
304
305
306
307 27000 TROLLF=.FALSE.
308 CALL NEWSTA(TROLL,0,MTROL,0,0)
309 WRITE(OUTCH,550)
310 GO TO 2000
311
312 550 FORMAT(' Restored troll.')
313
314
315
316 28000 CYCLOF=.FALSE.
317 MAGICF=.FALSE.
318 CALL NEWSTA(CYCLO,0,MCYCL,0,0)
319 WRITE(OUTCH,560)
320 GO TO 2000
321
322 560 FORMAT(' Restored cyclops.')
323
324
325
326 29000 DBGFLG=0
327 WRITE(OUTCH,570)
328 GO TO 2000
329
330 570 FORMAT(' Restored deaths.')
331
332
333
334
335
336 30000 IF(.NOT.VALID1(J,OLNT)) GO TO 2200
337 CALL NEWSTA(J,0,0,0,WINNER)
338 WRITE(OUTCH,580)
339 GO TO 2000
340
341 580 FORMAT(' Taken.')
342
343
344
345 31000 RETURN
346
347
348
349 32000 IF(.NOT.VALID3(J,RLNT,K,5)) GO TO 2200
350 WRITE(OUTCH,590) EQR(J,K)
351 READ(INPCH,600,ERR=2200,END=2000) EQR(J,K)
352 GO TO 2000
353
354 590 FORMAT(' Old= ',I6,6X,'New= ',$)
355 600 FORMAT(I6)
356
357
358
359 33000 IF(.NOT.VALID3(J,OLNT,K,14)) GO TO 2200
360 WRITE(OUTCH,590) EQO(J,K)
361 READ(INPCH,600,ERR=2200,END=2000) EQO(J,K)
362 GO TO 2000
363
364
365
366 34000 IF(.NOT.VALID3(J,ALNT,K,7)) GO TO 2200
367 WRITE(OUTCH,590) EQA(J,K)
368 READ(INPCH,600,ERR=2200,END=2000) EQA(J,K)
369 GO TO 2000
370
371
372
373 35000 IF(.NOT.VALID3(J,CLNT,K,4)) GO TO 2200
374 IF(K.EQ.3) GO TO 35500
375 IF(K.EQ.4) GO TO 35600
376 WRITE(OUTCH,590) EQC(J,K)
377 READ(INPCH,600,ERR=2200,END=2000) EQC(J,K)
378 GO TO 2000
379
380 35500 WRITE(OUTCH,480) CFLAG(J)
381 READ(INPCH,490,ERR=2200,END=2000) CFLAG(J)
382 GO TO 2000
383
384 35600 WRITE(OUTCH,480) CCNCEL(J)
385 READ(INPCH,490,ERR=2200,END=2000) CCNCEL(J)
386 GO TO 2000
387
388
389
390
391
392 36000 IF(.NOT.VALID1(J,XLNT)) GO TO 2200
393 IF(TRAVEL(J).LT.0) GO TO 36100
394 WRITE(OUTCH,610) TRAVEL(J)
395 READ(INPCH,620,ERR=2200,END=2000) TRAVEL(J)
396 GO TO 2000
397
398 36100 WRITE(OUTCH,590) TRAVEL(J)
399 READ(INPCH,600,ERR=2200,END=2000) TRAVEL(J)
400 GO TO 2000
401
402 610 FORMAT(' Old= ',O6,6X,'New= ',$)
403 620 FORMAT(O6)
404
405
406
407 37000 IF(.NOT.VALID3(J,VLNT,K,5)) GO TO 2200
408 WRITE(OUTCH,590) EQV(J,K)
409 READ(INPCH,600,ERR=2200,END=2000) EQV(J,K)
410 GO TO 2000
411
412
413
414 38000 IF(.NOT.VALID2(J,K,R2LNT)) GO TO 2200
415 DO 38100 I=J,K
416 WRITE(OUTCH,630) I,R2(I),O2(I)
417 38100 CONTINUE
418 GO TO 2000
419
420 630 FORMAT(' #',I2,' Room=',I6,' Obj=',I6)
421
422
423
424 39000 IF(.NOT.VALID2(J,K,SMAX)) GO TO 2200
425 DO 39100 I=J,K
426 WRITE(OUTCH,640) I,SWITCH(I)
427 39100 CONTINUE
428 GO TO 2000
429
430 640 FORMAT(' Switch #',I2,' = ',I6)
431
432
433
434 40000 IF(.NOT.VALID1(J,SMAX)) GO TO 2200
435 WRITE(OUTCH,590) SWITCH(J)
436 READ(INPCH,600,ERR=2200,END=2000) SWITCH(J)
437 GO TO 2000
438
439
440
441 41000 IF(.NOT.VALID2(J,K,MLNT)) GO TO 2200
442 WRITE(OUTCH,380)
443 DO 41100 I=J,K,10
444 L=MIN0(I+9,K)
445 WRITE(OUTCH,650) I,L,(RTEXT(L1),L1=I,L)
446 41100 CONTINUE
447 GO TO 2000
448
449 650 FORMAT(1X,I4,'-',I4,10(1X,I6))
450
451
452
453 42000 CALL RSPEAK(J)
454 GO TO 2000
455
456
457
458 43000 WRITE(OUTCH,590) HERE
459 READ(INPCH,600,ERR=2200,END=2000) HERE
460 AROOM(PLAYER)=HERE
461 GO TO 2000
462
463
464
465 44000 WRITE(OUTCH,660)
466 & OFLAG,OACT,OPREP1,OOBJ1,OPREP,ONAME,OPREP2,OOBJ2,
467 & LASTIT,ACT,OBJ1,OBJ2,PREP1,PREP2,SYN,
468 & BUNLNT,BUNSUB,BUNVEC
469 GO TO 2000
470
471 660 FORMAT(' ORPHS= ',5I7,' "',A,'" ',2I7/' IT= ',I7/
472 &' PV= ',5I7/' SYN= ',2O7,4I7/15X,O7,4I7/
473 &' BUNCH= ',7I7/22X,5I7)
474
475
476
477 45000 WRITE(OUTCH,610) PRSFLG
478 READ(INPCH,620,ERR=2200,END=2000) PRSFLG
479 GO TO 2000
480
481
482
483 46000 DO 46100 I=1,64,8
484 WRITE(OUTCH,670) (CPVEC(J),J=I,I+7)
485 46100 CONTINUE
486 GO TO 2000
487
488 670 FORMAT(2X,8I3)
489
490
491
492 47000 IF(.NOT.VALID1(J,64)) GO TO 2200
493 WRITE(OUTCH,590) CPVEC(J)
494 READ(OUTCH,600) CPVEC(J)
495 GO TO 2000
496
497