-
Notifications
You must be signed in to change notification settings - Fork 8
/
loop.zap
286 lines (279 loc) · 6.23 KB
/
loop.zap
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
.FUNCT MAIN-LOOP:ANY:0:0,TRASH
?PRG1: CALL1 MAIN-LOOP-1 >TRASH
JUMP ?PRG1
.FUNCT MAIN-LOOP-1:ANY:0:0,ICNT,OCNT,NUM,CNT,OBJ,TBL,V,PTBL,OBJ1,TMP,O,I
SET 'CNT,0
SET 'OBJ,FALSE-VALUE
SET 'PTBL,TRUE-VALUE
CALL1 PARSER >P-WON
ZERO? P-WON /?CCL3
GET P-PRSI,P-MATCHLEN >ICNT
GET P-PRSO,P-MATCHLEN >OCNT
ZERO? P-IT-OBJECT /?PRD7
CALL2 ACCESSIBLE?,P-IT-OBJECT
ZERO? STACK \?CCL5
?PRD7: ZERO? P-HIM-OBJECT /?PRD10
CALL2 ACCESSIBLE?,P-HIM-OBJECT
ZERO? STACK \?CCL5
?PRD10: ZERO? P-HER-OBJECT /?CND4
CALL2 ACCESSIBLE?,P-HER-OBJECT
ZERO? STACK /?CND4
?CCL5: SET 'TMP,FALSE-VALUE
?PRG15: IGRTR? 'CNT,ICNT /?REP16
GET P-PRSI,CNT
EQUAL? STACK,IT \?CCL22
ZERO? P-IT-OBJECT /?CCL22
PUT P-PRSI,CNT,P-IT-OBJECT
SET 'TMP,TRUE-VALUE
JUMP ?REP16
?CCL22: GET P-PRSI,CNT
EQUAL? STACK,HIM \?CCL26
ZERO? P-HIM-OBJECT /?CCL26
PUT P-PRSI,CNT,P-HIM-OBJECT
SET 'TMP,TRUE-VALUE
JUMP ?REP16
?CCL26: GET P-PRSI,CNT
EQUAL? STACK,HER \?PRG15
ZERO? P-HER-OBJECT /?PRG15
PUT P-PRSI,CNT,P-HER-OBJECT
SET 'TMP,TRUE-VALUE
?REP16: ZERO? TMP \?CND32
SET 'CNT,0
?PRG34: IGRTR? 'CNT,OCNT /?CND32
GET P-PRSI,CNT
EQUAL? STACK,IT \?CCL41
ZERO? P-IT-OBJECT /?CCL41
PUT P-PRSI,CNT,P-IT-OBJECT
JUMP ?CND32
?CCL41: GET P-PRSI,CNT
EQUAL? STACK,HIM \?CCL45
ZERO? P-HIM-OBJECT /?CCL45
PUT P-PRSI,CNT,P-HIM-OBJECT
JUMP ?CND32
?CCL45: GET P-PRSI,CNT
EQUAL? STACK,HER \?PRG34
ZERO? P-HER-OBJECT /?PRG34
PUT P-PRSI,CNT,P-HER-OBJECT
?CND32: SET 'CNT,0
?CND4: ZERO? OCNT \?CCL53
SET 'NUM,OCNT
JUMP ?CND51
?CCL53: GRTR? OCNT,1 \?CCL55
SET 'TBL,P-PRSO
ZERO? ICNT \?CCL58
SET 'OBJ,FALSE-VALUE
JUMP ?CND56
?CCL58: GET P-PRSI,1 >OBJ
?CND56: SET 'NUM,OCNT
JUMP ?CND51
?CCL55: GRTR? ICNT,1 \?CCL60
SET 'PTBL,FALSE-VALUE
SET 'TBL,P-PRSI
GET P-PRSO,1 >OBJ
SET 'NUM,ICNT
JUMP ?CND51
?CCL60: SET 'NUM,1
?CND51: ZERO? OBJ \?CND61
EQUAL? ICNT,1 \?CND61
GET P-PRSI,1 >OBJ
?CND61: EQUAL? PRSA,V?WALK \?CCL67
ZERO? P-WALK-DIR /?CCL67
CALL PERFORM,PRSA,PRSO >V
JUMP ?CND65
?CCL67: ZERO? NUM \?CCL71
GETB P-SYNTAX,P-SBITS
BAND STACK,P-SONUMS
ZERO? STACK \?CCL74
CALL2 PERFORM,PRSA >V
SET 'PRSO,FALSE-VALUE
JUMP ?CND65
?CCL74: ZERO? LIT \?CCL76
PRINTI "Es ist zu dunkel, um etwas zu sehen."
CRLF
JUMP ?CND65
?CCL76: ICALL1 REFERRING
SET 'V,FALSE-VALUE
JUMP ?CND65
?CCL71: SET 'P-NOT-HERE,0
SET 'P-MULT,FALSE-VALUE
GRTR? NUM,1 \?CND77
SET 'P-MULT,TRUE-VALUE
?CND77: SET 'TMP,FALSE-VALUE
?PRG79: IGRTR? 'CNT,NUM \?CCL83
GRTR? P-NOT-HERE,0 \?CCL86
PRINTI "The "
EQUAL? P-NOT-HERE,1 \?CCL89
PRINTI "Das"
JUMP ?CND87
?CCL89: PRINTI "Die"
?CND87: EQUAL? P-NOT-HERE,NUM /?CND90
PRINTI " andere "
?CND90: PRINTI "Ding"
EQUAL? P-NOT-HERE,1 /?CND92
PRINTC 101
?CND92: PRINTI " von dem du sprichst, "
EQUAL? P-NOT-HERE,1 /?CCL96
PRINTI "sind"
JUMP ?CND94
?CCL96: PRINTI "ist"
?CND94: PRINTI " nicht hier."
CRLF
JUMP ?CND65
?CCL86: ZERO? TMP \?CND65
PRINTI "Es gibt hier nichts, das man wegnehmen kann."
CRLF
JUMP ?CND65
?CCL83: ZERO? PTBL /?CCL100
GET P-PRSO,CNT >OBJ1
JUMP ?CND98
?CCL100: GET P-PRSI,CNT >OBJ1
?CND98: ZERO? PTBL /?CCL103
SET 'O,OBJ1
JUMP ?CND101
?CCL103: SET 'O,OBJ
?CND101: ZERO? PTBL /?CCL106
SET 'I,OBJ
JUMP ?CND104
?CCL106: SET 'I,OBJ1
?CND104: GRTR? NUM,1 /?CCL108
GET P-ITBL,P-NC1
GET STACK,0
EQUAL? STACK,W?ALLES \?CND107
?CCL108: LOC WINNER >V
EQUAL? O,NOT-HERE-OBJECT \?CCL113
INC 'P-NOT-HERE
JUMP ?PRG79
?CCL113: EQUAL? PRSA,V?TAKE \?CCL115
ZERO? I /?CCL115
GET P-ITBL,P-NC1
GET STACK,0
EQUAL? STACK,W?ALLES \?CCL115
IN? O,I \?PRG79
?CCL115: EQUAL? P-GETFLAGS,P-ALL \?CCL121
EQUAL? PRSA,V?TAKE \?CCL121
LOC O
EQUAL? STACK,WINNER,HERE,V /?PRD126
LOC O
EQUAL? STACK,I /?PRD126
LOC O
FSET? STACK,SURFACEBIT \?PRG79
?PRD126: FSET? O,TAKEBIT /?CCL121
FSET? O,TRYTAKEBIT \?PRG79
?CCL121: EQUAL? OBJ1,IT \?CCL134
ICALL DPRINT,P-IT-OBJECT,FALSE-VALUE
JUMP ?CND132
?CCL134: EQUAL? OBJ1,HIM \?CCL136
ICALL DPRINT,P-HIM-OBJECT,FALSE-VALUE
JUMP ?CND132
?CCL136: EQUAL? OBJ1,HER \?CCL138
ICALL DPRINT,P-HER-OBJECT,FALSE-VALUE
JUMP ?CND132
?CCL138: ICALL DPRINT,OBJ1,FALSE-VALUE
?CND132: PRINTI ": "
?CND107: SET 'PRSO,O
SET 'PRSI,I
SET 'TMP,TRUE-VALUE
CALL PERFORM,PRSA,PRSO,PRSI >V
EQUAL? V,M-FATAL \?PRG79
?CND65: EQUAL? V,M-FATAL /?CND141
LOC WINNER
GETP STACK,P?ACTION
CALL STACK,M-END >V
?CND141: EQUAL? V,M-FATAL \?CND1
SET 'P-CONT,FALSE-VALUE
JUMP ?CND1
?CCL3: SET 'P-CONT,FALSE-VALUE
?CND1: ICALL1 NULL-F
ZERO? P-WON /FALSE
EQUAL? PRSA,V?SUPER-BRIEF,V?BRIEF,V?TELL /TRUE
EQUAL? PRSA,V?HINT,V?SAVE,V?VERBOSE /TRUE
EQUAL? PRSA,V?QUIT,V?VERSION,V?HINTS-OFF /TRUE
EQUAL? PRSA,V?SCRIPT,V?SCORE,V?RESTART /TRUE
EQUAL? PRSA,V?RESTORE,V?UNSCRIPT /TRUE
CALL1 CLOCKER >V
RETURN V
.FUNCT PERFORM:ANY:1:3,A,O,I,V,OA,OO,OI
SET 'OA,PRSA
SET 'OO,PRSO
SET 'OI,PRSI
ZERO? P-WALK-DIR \?CND1
EQUAL? IT,I,O \?CND1
ZERO? P-IT-OBJECT /?CTR6
CALL2 ACCESSIBLE?,P-IT-OBJECT
ZERO? STACK \?CCL7
?CTR6: ICALL1 REFERRING
RETURN 2
?CCL7: EQUAL? IT,O \?CCL13
SET 'O,P-IT-OBJECT
JUMP ?CND1
?CCL13: EQUAL? IT,I \?CND1
SET 'I,P-IT-OBJECT
?CND1: ZERO? P-WALK-DIR \?CND15
EQUAL? HIM,I,O \?CND15
ZERO? P-HIM-OBJECT /?CTR20
CALL2 ACCESSIBLE?,P-HIM-OBJECT
ZERO? STACK \?CCL21
?CTR20: ICALL1 REFERRING
RETURN 2
?CCL21: EQUAL? HIM,O \?CCL27
SET 'O,P-HIM-OBJECT
JUMP ?CND15
?CCL27: EQUAL? HIM,I \?CND15
SET 'I,P-HIM-OBJECT
?CND15: ZERO? P-WALK-DIR \?CND29
EQUAL? HER,I,O \?CND29
ZERO? P-HER-OBJECT /?CTR34
CALL2 ACCESSIBLE?,P-HER-OBJECT
ZERO? STACK \?CCL35
?CTR34: ICALL1 REFERRING
RETURN 2
?CCL35: EQUAL? HER,O \?CCL41
SET 'O,P-HER-OBJECT
JUMP ?CND29
?CCL41: EQUAL? HER,I \?CND29
SET 'I,P-HER-OBJECT
?CND29: SET 'PRSA,A
SET 'PRSI,I
SET 'PRSO,O
EQUAL? NOT-HERE-OBJECT,PRSO,PRSI \?CCL45
CALL1 NOT-HERE-OBJECT-F >V
ZERO? V \?CND43
?CCL45: SET 'O,PRSO
SET 'I,PRSI
ICALL2 THIS-IS-IT,PRSO
ICALL2 THIS-IS-IT,PRSI
GETP WINNER,P?ACTION
CALL STACK >V
ZERO? V \?CND43
LOC WINNER
GETP STACK,P?ACTION
CALL STACK,M-BEG >V
ZERO? V \?CND43
GET PREACTIONS,A
CALL STACK >V
ZERO? V \?CND43
ZERO? I /?CCL56
GETP I,P?ACTION
CALL STACK >V
ZERO? V \?CND43
?CCL56: ZERO? O /?CCL60
EQUAL? A,V?WALK /?CCL60
LOC O
ZERO? STACK /?CCL60
LOC O
GETP STACK,P?CONTFCN
CALL STACK >V
ZERO? V \?CND43
?CCL60: ZERO? O /?CCL66
EQUAL? A,V?WALK /?CCL66
GETP O,P?ACTION
CALL STACK >V
ZERO? V \?CND43
?CCL66: GET ACTIONS,A
CALL STACK >V
ZERO? V /?CND43
?CND43: SET 'PRSA,OA
SET 'PRSO,OO
SET 'PRSI,OI
RETURN V
.ENDI