-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtells.zap
237 lines (200 loc) · 3.97 KB
/
tells.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
.FUNCT DO-CURSET:ANY:2:2,Y,X
EQUAL? 1,CWIDTH,CHEIGHT \?CCL3
CURSET Y,X
RFALSE
?CCL3: MUL X,CWIDTH >X
MUL Y,CHEIGHT
CURSET STACK,X
RFALSE
.FUNCT DPRINT:ANY:2:2,OBJ,CASE
GETP OBJ,P?ADJDESC
ZERO? STACK /?CND1
GETP OBJ,P?ADJDESC
PRINT STACK
EQUAL? CASE,W?DER,W?DEN,W?DEM \?CCL5
EQUAL? CASE,W?DER /?CTR7
EQUAL? CASE,W?DEN \?CCL8
FSET? OBJ,DERBIT /?CCL8
?CTR7: PRINTC 101
JUMP ?CND3
?CCL8: PRINTI "en"
JUMP ?CND3
?CCL5: FSET? OBJ,DERBIT \?CCL14
PRINTI "er"
JUMP ?CND3
?CCL14: FSET? OBJ,DASBIT \?CCL16
EQUAL? CASE,W?EINEM /?CCL16
PRINTI "es"
JUMP ?CND3
?CCL16: FSET? OBJ,DIEBIT \?CCL20
EQUAL? CASE,W?EINEM \?CCL20
PRINTC 101
JUMP ?CND3
?CCL20: PRINTI "en"
?CND3: PRINTC 32
?CND1: PRINTD OBJ
RTRUE
.FUNCT DER-NOM-PRINT:ANY:1:1,OBJ
FSET? OBJ,DERBIT \?CCL3
PRINTI "der "
JUMP ?CND1
?CCL3: FSET? OBJ,DIEBIT \?CCL5
PRINTI "die "
JUMP ?CND1
?CCL5: FSET? OBJ,DASBIT \?CND1
PRINTI "das "
?CND1: CALL DPRINT,OBJ,W?DER
RSTACK
.FUNCT DER-NOM-CAP-PRINT:ANY:1:1,OBJ
FSET? OBJ,DERBIT \?CCL3
PRINTI "Der "
JUMP ?CND1
?CCL3: FSET? OBJ,DIEBIT \?CCL5
PRINTI "Die "
JUMP ?CND1
?CCL5: FSET? OBJ,DASBIT \?CND1
PRINTI "Das "
?CND1: CALL DPRINT,OBJ,W?DER
RSTACK
.FUNCT DER-ACC-PRINT:ANY:1:1,OBJ
FSET? OBJ,DERBIT \?CCL3
PRINTI "den "
JUMP ?CND1
?CCL3: FSET? OBJ,DIEBIT \?CCL5
PRINTI "die "
JUMP ?CND1
?CCL5: FSET? OBJ,DASBIT \?CND1
PRINTI "das "
?CND1: CALL DPRINT,OBJ,W?DEN
RSTACK
.FUNCT DER-ACC-CAP-PRINT:ANY:1:1,OBJ
FSET? OBJ,DERBIT \?CCL3
PRINTI "Den "
JUMP ?CND1
?CCL3: FSET? OBJ,DIEBIT \?CCL5
PRINTI "Die "
JUMP ?CND1
?CCL5: FSET? OBJ,DASBIT \?CND1
PRINTI "Das "
?CND1: CALL DPRINT,OBJ,W?DEN
RSTACK
.FUNCT DER-DAT-PRINT:ANY:1:1,OBJ
FSET? OBJ,DERBIT /?CTR2
FSET? OBJ,DASBIT \?CCL3
?CTR2: PRINTI "dem "
JUMP ?CND1
?CCL3: FSET? OBJ,DIEBIT \?CND1
PRINTI "der "
?CND1: CALL DPRINT,OBJ,W?DEM
RSTACK
.FUNCT EIN-NOM-PRINT:ANY:1:1,OBJ
FSET? OBJ,DERBIT /?CTR2
FSET? OBJ,DASBIT \?CCL3
?CTR2: PRINTI "ein "
JUMP ?CND1
?CCL3: FSET? OBJ,DIEBIT \?CND1
PRINTI "eine "
?CND1: CALL DPRINT,OBJ,W?EIN
RSTACK
.FUNCT EIN-NOM-CAP-PRINT:ANY:1:1,OBJ
FSET? OBJ,DASBIT /?CTR2
FSET? OBJ,DERBIT \?CCL3
?CTR2: PRINTI "Ein "
JUMP ?CND1
?CCL3: FSET? OBJ,DIEBIT \?CND1
PRINTI "Eine "
?CND1: CALL DPRINT,OBJ,W?EIN
RSTACK
.FUNCT EIN-ACC-PRINT:ANY:1:1,OBJ
FSET? OBJ,DERBIT \?CCL3
PRINTI "einen "
JUMP ?CND1
?CCL3: FSET? OBJ,DIEBIT \?CCL5
PRINTI "eine "
JUMP ?CND1
?CCL5: FSET? OBJ,DASBIT \?CND1
PRINTI "ein "
?CND1: CALL DPRINT,OBJ,W?EINEN
RSTACK
.FUNCT EIN-ACC-CAP-PRINT:ANY:1:1,OBJ
FSET? OBJ,DERBIT \?CCL3
PRINTI "Einen "
JUMP ?CND1
?CCL3: FSET? OBJ,DIEBIT \?CCL5
PRINTI "Eine "
JUMP ?CND1
?CCL5: FSET? OBJ,DASBIT \?CND1
PRINTI "Ein "
?CND1: CALL DPRINT,OBJ,W?EINEN
RSTACK
.FUNCT EIN-DAT-PRINT:ANY:1:1,OBJ
FSET? OBJ,DERBIT /?CTR2
FSET? OBJ,DASBIT \?CCL3
?CTR2: PRINTI "einem "
JUMP ?CND1
?CCL3: FSET? OBJ,DIEBIT \?CND1
PRINTI "einer "
?CND1: CALL DPRINT,OBJ,W?EINEM
RSTACK
.FUNCT PRONOUN-NOM-PRINT:ANY:1:1,OBJ
FSET? OBJ,DERBIT \?CCL3
PRINTI "er"
RTRUE
?CCL3: FSET? OBJ,DASBIT \?CCL5
PRINTI "es"
RTRUE
?CCL5: FSET? OBJ,DIEBIT \?CCL7
PRINTI "sie"
RTRUE
?CCL7: PRINTI "es"
RTRUE
.FUNCT PRONOUN-NOM-CAP-PRINT:ANY:1:1,OBJ
FSET? OBJ,DERBIT \?CCL3
PRINTI "Er"
RTRUE
?CCL3: FSET? OBJ,DIEBIT \?CCL5
PRINTI "Sie"
RTRUE
?CCL5: PRINTI "Es"
RTRUE
.FUNCT PRONOUN-ACC-PRINT:ANY:1:1,OBJ
FSET? OBJ,DERBIT \?CCL3
PRINTI "ihn"
RTRUE
?CCL3: FSET? OBJ,DIEBIT \?CCL5
PRINTI "sie"
RTRUE
?CCL5: PRINTI "es"
RTRUE
.FUNCT ZPROB:ANY:1:1,BASE
ZERO? LUCKY /?CCL3
RANDOM 100
GRTR? BASE,STACK /TRUE
RFALSE
?CCL3: RANDOM 300
GRTR? BASE,STACK /TRUE
RFALSE
.FUNCT RANDOM-ELEMENT:ANY:1:1,FROB
GET FROB,0
RANDOM STACK
GET FROB,STACK
RSTACK
.FUNCT PICK-ONE:ANY:1:1,FROB,L,CNT,RND,MSG,RFROB
GET FROB,0 >L
GET FROB,1 >CNT
DEC 'L
ADD FROB,2 >FROB
MUL CNT,2
ADD FROB,STACK >RFROB
SUB L,CNT
RANDOM STACK >RND
GET RFROB,RND >MSG
GET RFROB,1
PUT RFROB,RND,STACK
PUT RFROB,1,MSG
INC 'CNT
EQUAL? CNT,L \?CND1
SET 'CNT,0
?CND1: PUT FROB,0,CNT
RETURN MSG
.ENDI