all stats

Makefile_dot_in's stats

guessed the most

namecorrect guessesgames togetherratio
kimapr240.500
yeti260.333
essaie150.200
rrebbbbeca150.200
ponydork160.167
Moja040.000
oleander080.000
Dolphy060.000

were guessed the most by

namecorrect guessesgames togetherratio
Dolphy360.500
essaie250.400
rrebbbbeca250.400
yeti260.333
oleander280.250
ponydork060.000

entries

round #77

submitted at
0 likes

guesses
comments 0

post a comment


luacontroller.lua ASCII text
  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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
-- by hatsune miku
notes = {
  {delta = 0, duration = 0.1919355958333333, pitch = 0.7399888454232688},
  {delta = 0.3870969999999999, duration = 0.1919355958333333, pitch = 0.9877666025122482},
  {delta = 0.3870969999999999, duration = 0.1919355958333333, pitch = 0.6592551138257399},
  {delta = 0.387097, duration = 0.1919355958333333, pitch = 0.7399888454232688},
  {delta = 0.387097, duration = 0.1919355958333333, pitch = 0.9877666025122482},
  {delta = 0.387097, duration = 0.1919355958333333, pitch = 0.6592551138257399},
  {delta = 0.3870969999999998, duration = 0.1919355958333333, pitch = 0.7399888454232688},
  {delta = 0.3870969999999998, duration = 0.1919355958333333, pitch = 0.9877666025122482},
  {delta = 0.3870969999999998, duration = 0.1919355958333333, pitch = 0.6592551138257399},
  {delta = 0.3870969999999998, duration = 0.1919355958333333, pitch = 0.6592551138257399},
  {delta = 0.3870969999999998, duration = 0.19193559583333286, pitch = 0.7399888454232688},
  {delta = 0.3870969999999998, duration = 0.19193559583333375, pitch = 0.4938833012561241},
  {delta = 0.3870970000000007, duration = 0.5161293333333337, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.19193559583333375, pitch = 0.1849972113558172},
  {delta = 0.3870970000000007, duration = 0.19193559583333286, pitch = 0.24694165062806206},
  {delta = 0.3870969999999998, duration = 0.3661292458333332, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.19193559583333286, pitch = 0.16481377845643497},
  {delta = 0.3870969999999998, duration = 0.5161293333333337, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.19193559583333375, pitch = 0.1849972113558172},
  {delta = 0.3870970000000007, duration = 0.19193559583333286, pitch = 0.24694165062806206},
  {delta = 0.3870969999999998, duration = 0.3661292458333332, pitch = 0.39199543598174924},
  {delta = 0.0, duration = 0.19193559583333286, pitch = 0.16481377845643497},
  {delta = 0.3870969999999998, duration = 0.5161293333333337, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.19193559583333375, pitch = 0.1849972113558172},
  {delta = 0.3870970000000007, duration = 0.19193559583333286, pitch = 0.24694165062806206},
  {delta = 0.3870969999999998, duration = 0.19193559583333286, pitch = 0.16481377845643497},
  {delta = 0.3870969999999998, duration = 0.19193559583333375, pitch = 0.1849972113558172},
  {delta = 0.3870970000000007, duration = 0.19193559583333375, pitch = 0.24694165062806206},
  {delta = 0.3870970000000007, duration = 0.3661292458333332, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.19193559583333375, pitch = 0.16481377845643497},
  {delta = 0.3870970000000007, duration = 0.5161293333333337, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.19193559583333375, pitch = 0.1849972113558172},
  {delta = 0.3870970000000007, duration = 0.19193559583333375, pitch = 0.24694165062806206},
  {delta = 0.3870970000000007, duration = 0.3661292458333332, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.19193559583333375, pitch = 0.16481377845643497},
  {delta = 0.3870970000000007, duration = 0.5161293333333337, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.19193559583333375, pitch = 0.1849972113558172},
  {delta = 0.3870970000000007, duration = 0.19193559583333375, pitch = 0.24694165062806206},
  {delta = 0.3870970000000007, duration = 0.19193559583333375, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.19193559583333375, pitch = 0.16481377845643497},
  {delta = 0.3870970000000007, duration = 0.5161293333333337, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.19193559583333375, pitch = 0.1849972113558172},
  {delta = 0.3870970000000007, duration = 0.19193559583333375, pitch = 0.24694165062806206},
  {delta = 0.3870970000000007, duration = 0.19193559583333375, pitch = 0.16481377845643497},
  {delta = 0.3870970000000007, duration = 0.19193559583333375, pitch = 0.1849972113558172},
  {delta = 0.3870970000000007, duration = 0.19193559583333375, pitch = 0.24694165062806206},
  {delta = 0.3870970000000007, duration = 0.3661292458333332, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.19193559583333375, pitch = 0.16481377845643497},
  {delta = 0.3870970000000007, duration = 0.5161293333333337, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.19193559583333375, pitch = 0.1849972113558172},
  {delta = 0.3870970000000007, duration = 0.19193559583333375, pitch = 0.24694165062806206},
  {delta = 0.3870970000000007, duration = 0.3661292458333332, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.19193559583333375, pitch = 0.16481377845643497},
  {delta = 0.3870970000000007, duration = 0.5161293333333337, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.19193559583333375, pitch = 0.1849972113558172},
  {delta = 0.3870970000000007, duration = 0.19193559583333375, pitch = 0.24694165062806206},
  {delta = 0.3870970000000007, duration = 0.3661292458333314, pitch = 0.39199543598174924},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.16481377845643497},
  {delta = 0.38709699999999714, duration = 0.5161293333333319, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.1849972113558172},
  {delta = 0.38709699999999714, duration = 0.19193559583333553, pitch = 0.24694165062806206},
  {delta = 0.3870970000000007, duration = 0.19193559583333197, pitch = 0.16481377845643497},
  {delta = 0.38709699999999714, duration = 0.19193559583333197, pitch = 0.1849972113558172},
  {delta = 0.38709699999999714, duration = 0.19193559583333197, pitch = 0.24694165062806206},
  {delta = 0.38709699999999714, duration = 0.3661292458333314, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.16481377845643497},
  {delta = 0.38709699999999714, duration = 0.5161293333333319, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.1849972113558172},
  {delta = 0.38709699999999714, duration = 0.19193559583333553, pitch = 0.24694165062806206},
  {delta = 0.3870970000000007, duration = 0.3661292458333314, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.16481377845643497},
  {delta = 0.38709699999999714, duration = 0.5161293333333319, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.1849972113558172},
  {delta = 0.38709699999999714, duration = 0.19193559583333553, pitch = 0.24694165062806206},
  {delta = 0.3870970000000007, duration = 0.3661292458333314, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.16481377845643497},
  {delta = 0.38709699999999714, duration = 0.5161293333333319, pitch = 0.27718263097687207},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.1849972113558172},
  {delta = 0.38709699999999714, duration = 0.19193559583333553, pitch = 0.24694165062806206},
  {delta = 0.3870970000000007, duration = 0.3661292458333314, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.16481377845643497},
  {delta = 0.38709699999999714, duration = 0.7338713958333294, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.1849972113558172},
  {delta = 0.38709699999999714, duration = 0.19193559583333197, pitch = 0.24694165062806206},
  {delta = 0.38709699999999714, duration = 0.3661292458333314, pitch = 0.39199543598174924},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.16481377845643497},
  {delta = 0.38709699999999714, duration = 0.5161293333333319, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.1849972113558172},
  {delta = 0.0, duration = 2.204839995833325, pitch = 0.12347082531403103},
  {delta = 0.38709699999999714, duration = 0.19193559583333553, pitch = 0.24694165062806206},
  {delta = 0.3870970000000007, duration = 0.3661292458333314, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.16481377845643497},
  {delta = 0.38709699999999714, duration = 0.5161293333333319, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.1849972113558172},
  {delta = 0.38709699999999714, duration = 0.19193559583333553, pitch = 0.24694165062806206},
  {delta = 0.3870970000000007, duration = 0.3661292458333314, pitch = 0.39199543598174924},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.16481377845643497},
  {delta = 0.38709699999999714, duration = 0.7758069041666609, pitch = 0.44},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.1849972113558172},
  {delta = 0.0, duration = 2.204839995833318, pitch = 0.09799885899543734},
  {delta = 0.38709699999999714, duration = 0.19193559583333197, pitch = 0.24694165062806206},
  {delta = 0.38709699999999714, duration = 0.19193559583333197, pitch = 0.16481377845643497},
  {delta = 0.38709699999999714, duration = 0.19193559583333197, pitch = 0.1849972113558172},
  {delta = 0.38709699999999714, duration = 0.3661292458333314, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.24694165062806206},
  {delta = 0.38709699999999714, duration = 0.3661292458333314, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.16481377845643497},
  {delta = 0.38709699999999714, duration = 0.5161293333333319, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.1849972113558172},
  {delta = 0.0, duration = 2.204839995833325, pitch = 0.1468323839587038},
  {delta = 0.38709699999999714, duration = 0.19193559583333553, pitch = 0.24694165062806206},
  {delta = 0.3870970000000007, duration = 0.3661292458333314, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.16481377845643497},
  {delta = 0.38709699999999714, duration = 0.5161293333333319, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.1849972113558172},
  {delta = 0.38709699999999714, duration = 0.19193559583333553, pitch = 0.24694165062806206},
  {delta = 0.3870970000000007, duration = 0.3661292458333314, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.16481377845643497},
  {delta = 0.38709699999999714, duration = 0.06129035833333418, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.19193559583333553, pitch = 0.1849972113558172},
  {delta = 0.0, duration = 2.2048399958333285, pitch = 0.11},
  {delta = 0.06290326250000078, duration = 0.4725809208333338, pitch = 0.27718263097687207},
  {delta = 0.3241937374999999, duration = 0.19193559583333553, pitch = 0.24694165062806206},
  {delta = 0.3870970000000007, duration = 0.19193559583333197, pitch = 0.16481377845643497},
  {delta = 0.38709699999999714, duration = 0.19193559583333197, pitch = 0.1849972113558172},
  {delta = 0.38709699999999714, duration = 0.3661292458333314, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.19193559583333197, pitch = 0.24694165062806206},
  {delta = 0.3870970000000007, duration = 0.36612924583333495, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.19193559583333553, pitch = 0.16481377845643497},
  {delta = 0.38709700000000424, duration = 0.516129333333339, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.19193559583333553, pitch = 0.1849972113558172},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.12347082531403103},
  {delta = 0.38709700000000424, duration = 0.19193559583333553, pitch = 0.24694165062806206},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.19193559583333553, pitch = 0.16481377845643497},
  {delta = 0.38709700000000424, duration = 0.516129333333339, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.19193559583333553, pitch = 0.1849972113558172},
  {delta = 0.38709700000000424, duration = 0.19193559583333553, pitch = 0.24694165062806206},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.39199543598174924},
  {delta = 0.0, duration = 0.19193559583333553, pitch = 0.16481377845643497},
  {delta = 0.38709700000000424, duration = 0.516129333333339, pitch = 0.44},
  {delta = 0.0, duration = 0.19193559583333553, pitch = 0.1849972113558172},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.09799885899543734},
  {delta = 0.38709700000000424, duration = 0.19193559583333553, pitch = 0.24694165062806206},
  {delta = 0.38709700000000424, duration = 0.19193559583333553, pitch = 0.16481377845643497},
  {delta = 0.38709700000000424, duration = 0.19193559583333553, pitch = 0.1849972113558172},
  {delta = 0.38709700000000424, duration = 0.19193559583333553, pitch = 0.24694165062806206},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.19193559583333553, pitch = 0.16481377845643497},
  {delta = 0.38709700000000424, duration = 1.1016135458333451, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.19193559583333553, pitch = 0.1849972113558172},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.1468323839587038},
  {delta = 0.38709700000000424, duration = 0.19193559583333553, pitch = 0.24694165062806206},
  {delta = 0.38709700000000424, duration = 0.19193559583333553, pitch = 0.16481377845643497},
  {delta = 0.38709700000000424, duration = 1.101613545833338, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.19193559583333553, pitch = 0.1849972113558172},
  {delta = 0.38709700000000424, duration = 0.19193559583333553, pitch = 0.24694165062806206},
  {delta = 0.38709700000000424, duration = 0.19193559583333553, pitch = 0.16481377845643497},
  {delta = 0.38709699999999714, duration = 1.1016135458333451, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.19193559583333553, pitch = 0.1849972113558172},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.11},
  {delta = 0.38709700000000424, duration = 0.19193559583333553, pitch = 0.24694165062806206},
  {delta = 0.38709700000000424, duration = 0.19193559583333553, pitch = 0.16481377845643497},
  {delta = 0.38709700000000424, duration = 1.101613545833338, pitch = 0.27718263097687207},
  {delta = 0.0, duration = 0.19193559583333553, pitch = 0.1849972113558172},
  {delta = 0.38709700000000424, duration = 0.19193559583333553, pitch = 0.24694165062806206},
  {delta = 0.38709700000000424, duration = 0.19193559583333553, pitch = 0.16481377845643497},
  {delta = 0.38709699999999714, duration = 0.36612924583333495, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.24694165062806206},
  {delta = 0.0, duration = 1.1016135458333451, pitch = 0.1468323839587038},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.12347082531403103},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.1849972113558172},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.4938833012561241},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.24694165062806206},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.24694165062806206},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.24694165062806206},
  {delta = 0.0, duration = 0.550000320833341, pitch = 0.1468323839587038},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.4938833012561241},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.24694165062806206},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.24694165062806206},
  {delta = 0.38709700000000424, duration = 0.73387139583334, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.19599771799087462},
  {delta = 0.0, duration = 1.1016135458333451, pitch = 0.12347082531403103},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.09799885899543734},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.1468323839587038},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.19599771799087462},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.4938833012561241},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.19599771799087462},
  {delta = 0.38709700000000424, duration = 0.73387139583334, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.19599771799087462},
  {delta = 0.0, duration = 0.550000320833341, pitch = 0.12347082531403103},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.19599771799087462},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.19599771799087462},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.0, duration = 1.1016135458333451, pitch = 0.1849972113558172},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.1468323839587038},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.27718263097687207},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.0, duration = 0.550000320833341, pitch = 0.1849972113558172},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.38709700000000424, duration = 0.73387139583334, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.0, duration = 1.1016135458333451, pitch = 0.13859131548843603},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.11},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.16481377845643497},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.27718263097687207},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.38709700000000424, duration = 0.73387139583334, pitch = 0.24694165062806206},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.0, duration = 0.550000320833341, pitch = 0.13859131548843603},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.24694165062806206},
  {delta = 0.0, duration = 1.1016135458333451, pitch = 0.1468323839587038},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.12347082531403103},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.1849972113558172},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.4938833012561241},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.24694165062806206},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.32962755691286993},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.24694165062806206},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.24694165062806206},
  {delta = 0.0, duration = 0.550000320833341, pitch = 0.1468323839587038},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.3699944227116344},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.4938833012561241},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.24694165062806206},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.6592551138257399},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.24694165062806206},
  {delta = 0.38709700000000424, duration = 0.73387139583334, pitch = 0.5873295358348152},
  {delta = 0.0, duration = 0.73387139583334, pitch = 0.7839908719634985},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.19599771799087462},
  {delta = 0.0, duration = 1.1016135458333451, pitch = 0.12347082531403103},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.09799885899543734},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.1468323839587038},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.19599771799087462},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.7399888454232688},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.19599771799087462},
  {delta = 0.38709700000000424, duration = 0.73387139583334, pitch = 0.5873295358348152},
  {delta = 0.0, duration = 0.73387139583334, pitch = 0.7399888454232688},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.19599771799087462},
  {delta = 0.0, duration = 0.550000320833341, pitch = 0.12347082531403103},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.19599771799087462},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.7399888454232688},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.19599771799087462},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.44},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.6592551138257399},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 1.1016135458333451, pitch = 0.16481377845643497},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.1468323839587038},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.22},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.5873295358348152},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.2936647679174076},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.5543652619537441},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.2936647679174076},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.44},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.6592551138257399},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.2936647679174076},
  {delta = 0.0, duration = 0.550000320833341, pitch = 0.16481377845643497},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.5873295358348152},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.2936647679174076},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.5543652619537441},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.2936647679174076},
  {delta = 0.38709700000000424, duration = 0.516129333333339, pitch = 0.4938833012561241},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.0, duration = 1.1016135458333451, pitch = 0.13859131548843603},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.11},
  {delta = 0.0, duration = 2.2048399958333533, pitch = 0.16481377845643497},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.44},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.38709700000000424, duration = 0.516129333333339, pitch = 0.4938833012561241},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.0, duration = 0.550000320833341, pitch = 0.13859131548843603},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.38709700000000424, duration = 0.36612924583333495, pitch = 0.44},
  {delta = 0.0, duration = 0.36612924583333495, pitch = 0.22},
  {delta = 0.38709700000000424, duration = 0.5161293333333319, pitch = 0.4938833012561241},
}

function run_nilable(f, ...) if f ~= nil then return f(...) end end

F = {}

function F.program()
  mem.note_idx = 1
end

function play_note()
  local note = notes[mem.note_idx]
  digiline_send("digistuff_noteblock", {sound = "sine", pitch = note.pitch, cut = note.duration})
  mem.note_idx = mem.note_idx + 1
end

function F.interrupt()
  play_note()
  while notes[mem.note_idx] do
    local note = notes[mem.note_idx]
    if note.delta > 0 then
      interrupt(note.delta)
      return
    end
    play_note()
  end
end

F.on = F.interrupt

run_nilable(F[event.type])

round #76

submitted at
0 likes

guesses
comments 0

post a comment


dir interpreter
dir js
interpreter.js ASCII text
  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
287
288
289
function display(s) {
	document.getElementById("output").innerHTML += s;
}

// A limited stack.
function Stack(array) {
	this.array = array;
	this.as_html = () => this.array.map(el => `<td><pre>${JSON.stringify(el)}</pre></td>`).join(""); 
	this.update_debug_table = function() {
		let row = document.getElementById("current-stack");
		row.innerHTML = `<td>current</td>${this.as_html()}`
	}
	function update_on_call(f) {
		return function(...a) {
			let retval = f(...a);
			this.update_debug_table();
			return retval;
		}
	}
	this.push = update_on_call((...x) => this.array.push(...x));
	this.pop  = update_on_call(() => this.array.pop());
	this.dump = function() {
		display(this.array.join(", "));
	}
}

function add_call_info(token, state) {
	let table = document.getElementById("debug");
	let row = table.insertRow();
	row.innerHTML = `<td><pre>${token.type}(${token.payload})</pre></td>${state.stack.as_html()}`;
}

function Settings(debug, nya_delay) {
	this.debug = debug;
	this.nya_delay = nya_delay;
}

function State(stack, settings, builtins) {
	this.settings = settings;
	this.stack = stack;
	this.functions = {};
	Object.assign(this.functions, builtins);
}

function Token(type, payload) {
	this.type    = type    || "";
	this.payload = payload || "";
}

function Error(code) {
	this.code = code;
}

const errors = {
	type: () => debug(new Error(1))
};

function asyncsleep(t) {
	return new Promise(resolve => setInterval(resolve, t));
}


function nyaypeof(x) {
	switch (typeof(x)) {
	case "number": return "num";
	case "string": return "str";
	case "boolean": return "bool";
	case "undefined": return "void";
	case "object":
		if (x instanceof Error)
			return "err";
	default:
		display(`Error: Cannot determine the type of ${x}\n`);
	}
}


function nyaize(types, f) {
	types.reverse();
	return async function(s) {
		let invalid = false;
		let args = types.map(type => {
			switch (type) {
			case "stack": return s.stack;
			case "any":   return s.stack.pop();
			case "state": return s;
			default:
				let arg = s.stack.pop();
				let argtype = nyaypeof(arg);

				if (argtype !== type) {
					invalid = true;
				}
				return arg;
			}
		});
		if (invalid) {
			s.stack.push(errors.type());
			return;
		}
		let retval = f(...args.reverse());
		if (retval instanceof Promise)
			retval = await retval;

		if (retval instanceof Array)
			s.stack.push(...retval);
		else if (retval !== undefined)
			s.stack.push(retval);
	}
}

const binnum = ["num", "num"];
const binstr = ["str", "str"];
const binbool = ["bool", "bool"]
const builtins = {
	"+":  nyaize(binnum, (a, b) => a + b),
	"-":  nyaize(binnum, (a, b) => a - b),
	"*":  nyaize(binnum, (a, b) => a * b),
	"/":  nyaize(binnum, (a, b) => a / b),
	"%":  nyaize(binnum, (a, b) => a % b),
	">":  nyaize(binnum, (a, b) => a > b),
	"<":  nyaize(binnum, (a, b) => a < b),
	"=":  nyaize(binnum, (a, b) => a == b),
	">=": nyaize(binnum, (a, b) => a >= b),
	"<=": nyaize(binnum, (a, b) => a <= b),
	".":  nyaize(binstr, (a, b) => a + b),
	"&":  nyaize(binbool,(a, b) => a && b),
	"|":  nyaize(binbool,(a, b) => a || b),
	"AwA":nyaize(["bool"], a => !a),
	"Nya":nyaize(["state", "str", "bool"], async function(s, code, cond) {
		while (cond) {
			if (nyaypeof(cond) !== "bool") {
				s.stack.push(errors.type());
				break;
			}
			await execute(code, s);
			await asyncsleep(s.settings.nya_delay);
			cond = s.stack.pop();
		}
	}),
	"Nom":nyaize(["stack", "num"], function(s, n) {
		for (let i = 0; i < n + 1; i++)
			s.pop();
	}),
	"Meow": nyaize(["str"], display),
	"Myaff": nyaize(["num"], num => num.toString()),
	"Dup" :nyaize(["any"], x => [x, x]),
	"ayN": nyaize(["stack", "num"], (s, a) => Array(a).fill(null).map(_ => s.pop())),
	"Nyurr": nyaize(["state", "str", "str"], function(state, code, name) {
		state.functions[name] = async (s) => {
			await execute(code, s);
		};
	}),
	"Nyaypeof": nyaize(["any"], nyaypeof)
};

// for debugging the interpreter (place your breakpoints here)
function debug(payload) {
	return;
}

async function run_token(token, s) {
	switch (token.type) {
	case 'n': s.stack.push(parseFloat(token.payload));                    break;
	case 's': s.stack.push(token.payload);                                break;
	case 'b': s.stack.push({"Purr": true, "HISS": false}[token.payload]); break;
	case 'f': await s.functions[token.payload](s);                          break;
	case 'd':
		if (s.settings.debug) {
			display(`Breakpoint ${token.payload}\nStack dump:`);
			s.stack.dump();
			display(`\n`);
		}
		break;
	case 'e': if (s.settings.debug)
		debug(token.payload);
		break;
	case 'c': break; // comment
	default: return false;
	}
	return true;

}

function tokenize(code) {
	code += " ";
	let tokens = [];
	let paren_depth = 0;
	let current_token = new Token();
	let current_mode = null;
	let whitespace = /\s/;
	/* two types of mode switching:
	   current_mode = modes.x // switches the mode to x with the next iteration
	   modes.x()              // switches the mode to x in this iteration

	   three modes:
	   none: parses types and consumes whitespace
	   simple: parses simple payloads
	   paren: parses parenthetical payloads
	*/
	let modes = {
		simple: function(c) {
			current_mode = modes.simple;
			if (whitespace.test(c)) {
				modes.none(c);
				return;
			} else if (c == "(") {
				modes.paren(c);
				return;
			}
			current_token.payload += c;
		},
		none: function(c) {
			current_mode = modes.none;
			if (whitespace.test(c)) {
				if (current_token.type != "") {
					tokens.push(current_token);
					current_token = new Token();
				}
				return;
			}
			current_token.type = c;
			current_mode = modes.simple;
		},
		paren: function(c) {
			current_mode = modes.paren;
			let internal_paren_depth = null;
			switch (c) {
			case '(':
				paren_depth++;
				if (paren_depth == 1)
					return;
				break;
			case ')':
				paren_depth--;
				if (paren_depth == 0) {
					current_mode = modes.none;
					return;
				}
				break;
			}
			current_token.payload += c;
		}


	};
	current_mode = modes.none;

	for (const c of code) {
		current_mode(c);
	}
	
	return tokens;
}

async function execute(code, state) {
	let tokens = tokenize(code);
	for (const token of tokens) {
		add_call_info(token, state);
		let valid = await run_token(token, state);
		if (!valid) {
			display(`Syntax error: Invalid type: ${token.type}\n`);
			break;
		}
	}
}
async function run() {
	let run_button = document.getElementById("run-button");
	run_button.disabled = true;
	run_button.innerHTML = "Running...";
	let stack = new Stack([]);
	let debug = document.getElementById("debug-mode").checked;
	let nya_delay = parseInt(document.getElementById("nya-delay").value);
	let settings = new Settings(debug, nya_delay);
	let state = new State(stack, settings, builtins);
	document.getElementById("output").innerHTML = "";
	await execute(document.getElementById("code").value, state);
	//	state.stack.dump();
	run_button.disabled = false;
	run_button.innerHTML = "Nya it out!";
}

function toggle_debug() {
	document.getElementById("demeow").classList.toggle("hidden");
}

function reset_table() {
	document.getElementById("debug").innerHTML = `<tr id="current-stack"></tr>`;
}
LICENSE ASCII text
1
2
3
The Nya General Public License.
THIS PROGRAM IS PROVIDED WITH NO WARRANTY, EXPRESS OR IMPLIED- and all that stuff.
Otherwise, you may use this program however you want, provided you agree to put on a cat ear headband upon the author's request.
fizzbuzz.txt ASCII text
 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
s(f% n0 f=) sDivides fNyurr c(creates a function named `divides' that cheks if the last element on the stack divides the second top element.)
s(fDup n100 f<) sNotReached100 fNyurr c(creates a function that returns whether 100 is the last element of the stack)

n0 c(starting value)
s(
	n1 f+ c(increment)
	s(
		sFizz fMeow bHISS
	)
        c(before reversal)
        n2 fayN c(first reversal)
        fDup    c(first duplication)
        n3 fayN c(second reversal)
        n2 fayN c(third reversal)
        n3 fDivides dCondition
        fDup    c(second suplication)
        n3 fayN c(fourth reversal)
        n2 fayN c(fifth reversal)
        fNya
	s(
		sBuzz fMeow bHISS
	) 
        n3 fayN c(first reversal #2)
        fDup    c(first duplication #2)
        n4 fayN c(second reversal #2)
        n2 fayN c(third reversal #2)
        n3 fayN c(fourth reversal #2)
        n5 fDivides dCondition
        fDup    c(second duplication #2)
        n3 fayN c(fifth reversal #2)
        n2 fayN c(sixth reversal #2)
        fNya
	s(
		fDup fMyaff fMeow bHISS e(exiting the loop)
	)
        c(before reversal #3)
        n3 fayN f| fAwA cCondition
        fNya
        cNumber
        s(
) fMeow
	fNotReached100 cCondition
) bPurr fNya
index.html ASCII text, with very long lines (588)
 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
<!DOCTYPE html>
<html>
  <head>
    <title>StackNya</title>
    <meta charset="utf-8">
    <style>
	.monospace {
		font-family: monospace;
	}
	td {
	    border: 1px solid black;
	}
	table {
	    max-width: 100vw;
	}
	pre {
	    text-overflow: ellipsis;
	    max-width: 20vw;
	    word-break: break-all;
	}
	.hidden {
	    display: none;
	}
    </style>
    <script src="js/interpreter.js"></script> 
  </head>
  <body>
    <h1>StackNya</h1>
    <h3>Description</h3>
    <p>StackNya is a stack-based language. This means that there's a single array (called a stack) around which all calculations are based. When a function is called, it receives its arguments by removing them from the stack.</p>
    <h3>Syntax</h3>
    <p>A StackNya program consists of one or mowe tokens. A token consists of a type (single letter) followed by a payload, optionally in parentheses, in which case it goes on as long as the initial parentheses are closed. Currently, these types exist: </p>
    <ul>
      <li><code>n</code> - pushes a number on the stack</li>
      <li><code>s</code> - pushes a string on the stack</li>
      <li><code>b</code> - pushes a boolean - <code>Purr</code> or <code>HISS</code></li>
      <li><code>f</code> - calls a function</li>
      <li><code>d</code> - dumps the stack to output - mostly obsolete due to the demeowing table</li>
      <li><code>e</code> - calls a function that does nothing but can be used to debug the interpreter at specific points by placing a breakpoint on that function.</li>
      <li><code>c</code> - no-op. Useful for comments and annotations for the demeowing table.</li>
    </ul>
    <h3>Functions</h3>
    <p>Functions that correspond to binary operators work mostly as you'd expect, taking the second-to-top element on the stack as their first argument, and the top element as their second argument. These include <p><code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, <code>%</code>, <code>&gt;</code>, <code>&lt;</code>, <code>=</code> (like C <code>==</code>), <code>&gt;=</code>, <code>&lt;=</code>, <code>.</code> (used for concatenation - <code>+</code> works for integers only), <code>&amp;</code>, <code>|</code> (like C <code>&amp;&amp;</code> and <code>||</code>)</p>
    </p>
    <p>The others are:</p>
    <ul>
      <li><code>AwA</code> - negates the top of s.</li>
      <li><code>Nya</code> - takes 2 arguments: a string containing code and a boolean, then, if the boolean is true, runs the code as long as the top of the stack is <code>bPurr</code></li>
      <li><code>Nom</code> - takes a single numeric argument and consumes that many + 1 (because it also has to consume its argument) elements from the stack</li>
      <li><code>Meow</code> - takes a string and outputs it</li>
      <li><code>Myaff</code> - converts a number to a string</li>
      <li><code>Dup</code> - duplicates the top of stack.</li>
      <li><code>ayN</code> - takes a numeric argument n, then reverses the last <em>n</em> elements of stack.</li>
      <li><code>Nyurr</code> - takes a string containing NyaStack code, another string containing a function name, and creates a function with that name</li>
      <li><code>Nyaypeof</code> - returns the type of the top element of the stack, consuming it in the process. Current types are <code>num</code>, <code>str</code>, <code>bool</code>, <code>void</code> and <code>err</code></li>
    </ul>
    <h3>Examples</h3>
    <h4>Hello, World!</h4>
    <code>
      s(Hello, World!) fMeow
    </code>
    <h4><code>yes</code></h4>
    <pre>
s(s(y
) fMeow bPurr) bPurr fNya
    </pre>
    <h4>FizzBuzz</h4>
    <iframe src="fizzbuzz.txt"></iframe>
    <h2>Interpreter</h2>
    <div><textarea cols="40" rows="5" type="text" class="monospace" id="code"></textarea></div>
    <button onclick="toggle_debug();">Toggle demeow tools</button>
    <button id="run-button" onclick="run();">Nya it out!</button><br>
    <label for="nya-delay">The delay between consecutive iterations as done by <code>Nya</code> (ms) (smaller is faster):</label>
    <input type="number" id="nya-delay" name="nya-delay" value="50">
    <div class="hidden" id="demeow">
    <h2>Demeowing</h2>
    <input type="checkbox" id="debug-mode" name="debug-mode">
    <label for="debug-mode">Demeowing mode (enables commands <code>d</code> un <code>e</code>)</label>
    <p>(Warning: the table is a little broken but CSS is hard-)</p>
    <button onclick="reset_table();">Reset table</button>
    <table id="debug">
      <tr id="current-stack"></tr>
    </table>
    </div>
    <pre id="output"></pre>
    </div>
  </body>
</html>
a.stacknya ASCII text
 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
s(
	c(a b)
	n2 fayN fDup
	c(b a a)
	n3 fayN
	c(a a b)
	n2 fayN
	c(a b a)
) c(a b -- a b a) sOver fNyurr

s(
	c(a b c)
	n3 fayN fDup
	c(c b a a)
	n4 fayN
	c(a a b c)
	n2 fayN
	c(a a c b)
	n3 fayN
	c(a b c a)
) c(a b c -- a b c a) sPick fNyurr

s(fOver fOver) c(a b -- a b a b) sDup2 fNyurr
s(fPick fPick fPick) c(a b c -- a b c a b c) sDup3 fNyurr

s(s__InternalDip fNyurr n2 fayN f__InternalDip n2 fayN) c(a b code -- a' b) sDip fNyurr

s(bPurr fNya) c(code --) sDoWhile fNyurr
s(s(s( bHISS) f.) fDip fNya) c(code --) sIf fNyurr

c(An array is a pair (len data) on the stack.)

s(n0 s()) c(-- len data) sEmptyArray fNyurr
s(fMyaff s( n) n2 fayN f. f. s(n1 f+) fDip) c(len data el -- len' data') sAppend fNyurr
s(
	c(ex: 1 2 3 4 5 6 7 8 9 10)
	n2 fayN s__InternalIdxA fNyurr
	c(len idx)
	n2 fayN fOver f-
	c(idx len-idx)
	s(f__InternalIdxA n0 n) n2 fayN fMyaff f.
	s( fNom fDup n) f. fOver n1 f+ fMyaff f.
	s( fayN n0 n) f. n2 fayN fMyaff f.
	s( fNom) f.
	s__InternalIdxB fNyurr
	f__InternalIdxB
) c(len data idx[1..] -- elem) sIdx fNyurr

s(1 2 ) fMeow

c(len data num uses)
n2 s(n1 n2) n2 n1
s(
	fDup n0 f<=
	s(
		n0 fNom
		c(len data num)
		n1 f+
		fDup3 fIdx
	) n2 fayN fIf

	n4 fayN n3 fayN
	c(uses len data num)
	fDup fMyaff s( ) f. fMeow
	fDup
	c(uses len data num num)
	n4 fayN n3 fayN fAppend
	c(uses num len' data')
	n2 fayN n4 fayN
	n1 f-
	bPurr
) fDoWhile

round #75

submitted at
1 like

guesses
comments 0

post a comment


75cg.janet ASCII text, with very long lines (2278), with CRLF line terminators
 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
# You need janet spork mpv yt-dlp
(import spork/base64)
(import spork/rawterm)
(import spork/utf8)
(import spork/sh)

# Spoilers!
(def questions "ICBbQHs6dXJsICJodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PTdKTkZiTG1sU1VZIiA6YW5zd2VyICJMYWd0cmFpbiIgOmNvbW1lbnQgImhpIDozIn0KICAgQHs6dXJsICJodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PXNiS1hpemo1V1U4IiA6YW5zd2VyICJUd28gWWVhcnMifQogICBAezp1cmwgImh0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9ZGxBZUVjVm5udm8iIDphbnN3ZXIgIll1a2FpIFlvdW5nIn0KICAgQHs6dXJsICJodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PWhsZ2MzXzRXTDBNIiA6YW5zd2VyICJNb25vcmFsIn0KICAgQHs6dXJsICJodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PWRQNHRfR0dsM0VzIiA6YW5zd2VyICJpbm5lciB1bml2ZXJzZSJ9CiAgIEB7OnVybCAiaHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj16aGwtQ3MxLXNHNCIgOmFuc3dlciAiR2lvcmdpbyBieSBNb3JvZGVyIn0KICAgQHs6dXJsICJodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PXRueVJCdVNzSXAwIiA6YW5zd2VyICJCYWthIG1pdGFpIGJ1dCBpdCdzIGluIHRva2kgcG9uYSJ9CiAgIEB7OnVybCAiaHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1QUmhqcVBDUEF0cyIgOmFuc3dlciAiWWFlZ2FraSJ9CiAgIEB7OnVybCAiaHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1hMERielVlLXI0USIgOmFuc3dlciAiSGVsaWtvcHRlciJ9CiAgIEB7OnVybCAiaHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1hNXVRTXdSTUhjcyIgOmFuc3dlciAiSW5zdGFudCBDcnVzaCJ9CiAgIEB7OnVybCAiaHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1sdXRxSnpHZlFNQSIgOmFuc3dlciAiZmVtaW5pbmUgYWRvcm5tZW50cyJ9CiAgIEB7OnVybCAiaHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1jUG5URmRNcFZzOCIgOmFuc3dlciAiSSBIYXZlbid0IEdvdCBBbnkgTGVncyJ9CiAgIEB7OnVybCAiaHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj0tMXRYSlc5Q01aMCIgOmFuc3dlciAiVGhlcmUgSXMgQSBMaWdodCBUaGF0IE5ldmVyIEdvZXMgT3V0In0KICAgQHs6dXJsICJodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PTFHYjJFVDk5TTNrIiA6YW5zd2VyICJrYWxhIGxpbGkgbGkga2FtYSB0YW4gbWEifQogICBAezp1cmwgImh0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9RVdITU5JQ3JDZjgiIDphbnN3ZXIgInN1c3N5IG1hY2hpbmUifQogICBAezp1cmwgImh0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9T3VpVEhNdXZxVDQiIDphbnN3ZXIgIkNhbmNpb24gZGVsIG1hcmlhY2hpIn0KICAgQHs6dXJsICJodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PVlub3BIQ0wxSms4IiA6YW5zd2VyICJEcmFnb3N0ZWEgRGluIFRlaSJ9CiAgIEB7OnVybCAiaHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1IaFphSGY4UlA2ZyIgOmFuc3dlciAiVmVyaWRpcyBRdW8ifQogICBAezp1cmwgImh0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9aHF0aHNwU0taVjgiIDphbnN3ZXIgIklldmFuIHBvbGtrYSJ9CiAgIEB7OnVybCAiaHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1LNUtBYzVDb0N1ayIgOmFuc3dlciAiRGVybmllcmUgRGFuc2UifV0=")
(def questions (parse (base64/decode questions)))

(def man0 "_________")
(def man
  ["   |\n   |\n   |"
   "\n _____\n|     |\n|     |\n|     |\n-----"
   "\n   |\n   |"
   "\n  /"
   " \\"
   "\n /"
   "   \\"])


(def mpv (os/spawn ["mpv"
  "--input-ipc-server=/tmp/mpv-quiz.socket"
  "--keep-open=always"
  "--no-video"
  "--no-terminal"
  ;(map |(get $ :url) questions)] :p))

(rawterm/begin)
(print "In this quiz you will hear songs and have to guess their names hangman-style.")
(print "Please wait a bit for the playback to start.")
(print "If the program crashes, you may need to use pkill mpv and tput reset.")
(print "During the quiz, press ^C to exit.")
(prin "Press any key to continue: ")
(flush)
(rawterm/getch)
(def sock (net/connect :unix "/tmp/mpv-quiz.socket"))
(var points 0)
(var prevanswer "")
(each q questions
  (def {:url url :answer answer} q)
  (var wrong @"")
  (var correct @" '")
  (def testanswer (string/ascii-upper answer))
  (while (and (< (length wrong) (length man)) (not (string/check-set correct testanswer)))
    (prin "\x1b[2J\x1b[H")
    (printf "Previous answer: %s\n" prevanswer)
    (print man0)
    (print (string/join (slice man 0 (length wrong))))
    (prin "\n\n")
    (each char testanswer
      (cond
        (has-value? correct char) (prinf "%c" char)
        (= char 32) (prin " ")
        (= char 39) (prin "'")
        (prin "_"))
      (prin " "))
    (prin "\n\n")
    (prin "Guessed: ")
    (each char wrong (prinf "%c " char))
    (prin "\n\nEnter a character: ")
    (flush)
    (def char (get (string/ascii-upper (rawterm/getch)) 0))
    (when (= char 3)
      (rawterm/end)
      (os/proc-kill mpv)
      (os/exit))
    (when (and char
            (not= char 10)
            (not (has-value? correct char))
            (not (has-value? wrong char)))
      (if (has-value? testanswer char)
        (buffer/push correct char)
        (buffer/push wrong char))))
  (set (q :points) (- (length man) (length wrong)))
  (set prevanswer answer)
  (net/write sock "playlist-next force\nset pause no\n"))

(prin "\x1b[2J\x1b[H")
(printf "%-43s %-36s %-5s" "URL" "Answer" "Points")
(var total 0)
(each {:url url :answer answer :points points} questions
  (printf "%-43s %-36s %-5d" url answer points)
  (+= total points))

(printf "Total points: %d/%d. Goodbye." total (* (length questions) 7))
(rawterm/end)

(net/close sock)
(os/proc-wait mpv)

round #74

submitted at
1 like

guesses
comments 0

post a comment


cg73.tcl ASCII text
 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
package require http
package require tls

http::register https 443 ::tls::socket
http::config -useragent {DiscordBot (https://codeguessing.gay, 1.0.0) songebot/1.0 (zzz)}

set song_list {
    https://www.youtube.com/watch?v=T5Cp55MvX54
    https://www.youtube.com/watch?v=eA2kiCScnI8&t=56s
    https://www.youtube.com/watch?v=vW9_5giCK1I
    https://www.youtube.com/watch?v=nXZuv1T8bfg
    https://www.youtube.com/watch?v=Lt-EbHhHD5Q
}

proc send {token channel_id} {
    set song [lindex $::song_list [expr {round(floor([llength $::song_list] * rand()))}]]
    set token [http::geturl https://discord.com/api/v10/channels/$channel_id/messages \
        -method POST \
        -query [subst {{"content": "$song"}}] \
        -headers [dict create \
                      content-type application/json \
                      authorization "Bot $token"
                 ]]

    set ret [http::data $token]
    http::cleanup $token
    set ret
}

array set arguments $argv
puts [send $arguments(-token) $arguments(-channel-id)]

# Then it waddled away...
# Waddle waddle

round #73

submitted at
0 likes

guesses
comments 0

post a comment


Roboto-Regular.ttf TrueType Font data, 18 tables, 1st "GDEF", 13 names, Microsoft, language 0x409, Copyright 2011 Google Inc. All Rights Reserved.RobotoRegularVersion 2.001101; 2014Roboto-Regular
cat.png PNG image data, 48 x 48, 8-bit/color RGBA, non-interlaced
cg73.hs ASCII text
  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
{- cabal:
build-depends: base, wuss, websockets, aeson, lens, text, monomer, text-show, stm
-}

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE NamedFieldPuns #-}

module Main where

import Wuss
import Network.WebSockets (receiveData, sendTextData)
import Data.Aeson
import Control.Lens hiding ((.=))
import Data.Text (Text)
import Monomer
import Control.Concurrent.STM.TChan

import Control.Monad (forever)
import Data.Functor (void)
import Control.Concurrent (forkIO)
import Control.Concurrent.STM (atomically)
import qualified Monomer.Lens as L

data R
  = Connect { name :: Text }
  | Disconnect { name :: Text }
  | MessageR { name :: Text, content :: Text }
  deriving (Eq, Show)

instance FromJSON R where
  parseJSON = withObject "R" $ \o -> do
    reason <- o .: "reason"
    case reason :: Text of
      "connect" -> Connect <$> o .: "name"
      "disconnect" -> Disconnect <$> o .: "name"
      "message" -> MessageR <$> o .: "name" <*> o .: "content"
      _ -> fail $ "Unknown reason: " <> show reason

newtype S = S Text

instance ToJSON S where
  toJSON (S content) = object ["content" .= content]

data AppModel =
  AppModel
    { _messages :: [(Text, Text)]
    , _message :: Text
    , _users :: [Text]
    }
  deriving (Eq, Show)

data AppEvent
  = AppInit
  | AppWsEvent R
  | AppSendMessage
  | AppMessageSent
  | AppScrollUpdate ScrollStatus
  deriving (Eq, Show)


makeLenses 'AppModel

connectWs :: TChan S -> (AppEvent -> IO ()) -> IO ()
connectWs chan sendMessage =
  runSecureClient "codeguessing.gay" 443 "/73/ws" $ \con -> do
    void $ forkIO $ forever $ atomically (readTChan chan) >>= sendTextData con . encode
    forever $ receiveData con >>= mapM_ (sendMessage . AppWsEvent) . decode

buildUI
  :: WidgetEnv AppModel AppEvent
  -> AppModel
  -> WidgetNode AppModel AppEvent
buildUI _wenv model = widgetTree where
  widgetTree = hsplit_ [splitHandlePosV 0.9] (messageView, userlst)
  userlst = vscroll $ vstack $ map (`label_` [ellipsis]) $ model ^. users
  messageView = vstack_ [childSpacing]
    [ flip styleBasic [expandHeight 1]
      $ flip nodeKey "scroll"
      $ vscroll_
        [onChange AppScrollUpdate]
          $ vstack_ [childSpacing] $ reverse $
              map
                (\(sender, content) -> hstack_ [childSpacing]
                  [ label sender
                  , if content == ":cat_with_gua_pi_mao_hat_tone5:" then
                      image "cat.png" `styleBasic` [width 48, height 48]
                    else
                      label_ content [multiline]
                  ])
                (model ^. messages)
              & ix 0 %~ (`nodeKey` "first")
    , keystroke [("Enter", AppSendMessage)] $ textField message
    ] `styleBasic` [padding 10]

handleEvent
  :: TChan S
  -> WidgetEnv AppModel AppEvent
  -> WidgetNode AppModel AppEvent
  -> AppModel
  -> AppEvent
  -> [AppEventResponse AppModel AppEvent]
handleEvent chan wenv _node model evt = case evt of
  AppInit ->
    [Producer $ connectWs chan]
  AppWsEvent (MessageR {name, content}) ->
    [ Model (model & messages %~ ((name, content):))
    , responseMaybe $
        Message (WidgetKey "scroll") . ScrollTo . view L.viewport <$>
          nodeInfoFromKey wenv (WidgetKey "first")
    ]
  AppWsEvent (Connect {name}) ->
    [ Model (model & users %~ (name:)) ]
  AppWsEvent (Disconnect {name}) ->
    [ Model (model & users %~ filter (/=name)) ]
  AppSendMessage ->
    [ Task $ fmap (const AppMessageSent) $ atomically $ writeTChan chan $ S $ model ^. message
    , Model $ model & message .~ ""
    ]
  AppMessageSent ->
    []
  AppScrollUpdate (ScrollStatus {scrollRect = Rect x _ w h}) ->
    [Message (WidgetKey "scroll") $ Rect x (h+10) w (h+10)]


main :: IO ()
main = do
  chan <- atomically newTChan
  startApp model (handleEvent chan) buildUI config
  where
    config =
      [ appWindowTitle "Code Guessing"
      , appTheme darkTheme
      , appFontDef "Regular" "./Roboto-Regular.ttf"
      , appInitEvent AppInit
      ]
    model = AppModel
      { _messages = []
      , _message = ""
      , _users = []
      }

round #70

submitted at
0 likes

guesses
comments 0

post a comment


shipshipshitship.js ASCII text
 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
async function sendmoves(...lst) {
  const l = [];
  for (let { x = 0, y = 0, delay } of lst) {
    if (delay) await Promise.race([new Promise(resolve => setTimeout(() => resolve(), delay)), Promise.all(l)]);
    const xaxis = (x > 0) ? ["right", x] : ["left", -x];
    const yaxis = (y > 0) ? ["down",  y] : ["up",   -y];
    for (let [dir, length] of [xaxis, yaxis])
      for (let i = 0; i < length; ++i)
        l.push(fetch("/extra/game70", {method: "POST", body: JSON.stringify({dir}), headers}).then(r => r.json()));
  }

  let newState = await Promise.all(l)
    .then(rs => rs.reduce((a, b) => a.s > b.s ? a : b));
    
  if (newState !== undefined)
    renderGame(newState);
  return newState;
}

function findLocations(arr) {
  let plus, at, star;
  for (let y = 0; y < arr.length; ++y) {
    for (let x = 0; x < arr[y].length; ++x) {
     switch (arr[y][x]) {
        case "+": plus = [x, y]; break;
        case "@": at = [x, y]; break;
        case "*": star = [x, y]; break;
     }
    }
  }
  return {plus, at, star};
}

function vminus([x1, y1], [x2, y2]) { return [x1 - x2, y1 - y2]; }
function veq([x1, y1], [x2, y2]) { return x1 == x2 && y1 == y2; }

let x = false;

async function play() {
  while (!x) {
    const { plus, at: sat, star } = findLocations(screen.innerText.split("\n"));
    const at = [sat[0], sat[1]];
    const moves = [];
    const log = [];
    let n = 0;
    const x = x => { at[0] += x; n += Math.abs(x); moves.push({x}); };
    const y = y => { at[1] += y; n += Math.abs(y); moves.push({y}); };
    const delay = delay => { moves.push({delay: n * delay}); n = 0; };
    while (!veq(at, plus)) {
      const movevec = vminus(plus, at);
      if (star !== undefined) {
        const comet = vminus(star, at);
        const shenan = Math.sign(comet[0]) == Math.sign(movevec[0]) && Math.abs(comet[0]) <= Math.abs(movevec[0])
                    || Math.sign(comet[1]) == Math.sign(movevec[1]) && Math.abs(comet[1]) <= Math.abs(movevec[1]);
        const sxaxis = shenan && plus[0] == at[0] && at[0] == star[0];
        const syaxis = shenan && plus[1] == at[1] && at[1] == star[1];
        const interf = shenan && (plus[0] == star[0] || at[1] == star[1]);
        log.push({comet, shenan, sxaxis, syaxis, interf});
        if      (sxaxis) { x(plus[0] < 14 ? 1 : -1); delay(250);     }
        else if (syaxis) { y(plus[1] < 4  ? 1 : -1); delay(250);     }
        else if (interf) { y(movevec[1]); delay(150); x(movevec[0]); }
        else if (shenan) { x(movevec[0]); delay(150); y(movevec[1]); }
        else             { x(movevec[0]); y(movevec[1]);             }
      } else             { x(movevec[0]); y(movevec[1]);             }
    }
    const newstate = await sendmoves(...moves);
    console.log({plus, at, sat, star, moves, newstate, log, n});
    console.log(newstate.grid);
    await new Promise(resolve => setTimeout(() => resolve(), 10));
  }
}

round #69

submitted at
2 likes

guesses
comments 0

post a comment


cg69.el Unicode text, UTF-8 text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
(defun shitty-ries (n)
  (interactive "nThose who know: ")
  (with-temp-buffer
    (rename-buffer "Knowledge")
    (print `(= (- x ,n) 0) (current-buffer))
    (print `(= (- x (/ π ,(/ float-pi n))) 0) (current-buffer))
    (dotimes (i 10)
      (let ((r (+ n (random 0.01))) ; for increased fun
            (a (random))
            (y (random)))
        (print `(= (+ (* ,a (^ x 2)) (* ,(- (+ y r)) x) ,(* y r)) 0) (current-buffer))))
    (print-buffer)))
        
    

round #68

submitted at
0 likes

guesses
comments 0

post a comment


c.st Unicode text, UTF-8 text
  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
#!/home/olus2000/programy/smalltalk-3.2/gst

Object subclass: CipherCracker [
    | corpusBag inputBag count tbl |
    <comment: 'I crack subtitution ciphers ^_^'>

    CipherCracker class >> new [
        | r |
        r := super new.
        r init.
        ^r
    ]
    
    init [
        <category: 'initialization'>
        corpusBag := Bag new.
        inputBag := Bag new.
        count := 0.
    ]

    learn: corpus [
        <category: 'processing'>
        <comment: 'I update the cracker to expect text similar to the one provided.'>
        corpus do: [:c | c isLetter ifTrue: [corpusBag add: c asLowercase]].
    ]

    prescan: input [
        <category: 'processing'>
        <comment: 'I learn the frequency of letters in the input.'>
        input do: [:c | c isLetter ifTrue: [inputBag add: c asLowercase]].
    ]

    beforeCrack [
        <category: 'processing'>
        tbl := LookupTable new.
        inputBag sortedByCount
            with: corpusBag sortedByCount
            do: [:i :c | tbl at: i value put: c value].
    ]

    crack: string [
        <category: 'processing'>
        <comment: 'I cracka da string.'>
        count := count + 1.
        ^(string collect: [:c | c isUppercase
                              ifTrue: [(tbl at: c asLowercase ifAbsent: [c asLowercase]) asUppercase]
                              ifFalse: [tbl at: c ifAbsent: [c]]
                          ]) asString
    ]

    stats [
        <category: 'statistics'>
        ^'BORN TO SPAM
WORLD IS A MJAU
鬼神 Love Em All %1
I am l​ouna ^_^
' % { count }
    ]    
]

Dictionary extend [
    at: key ifAbsent: absent ifPresent: present [
        present value: (self at: key ifAbsent: [^absent value])
    ]
]
FileStream class extend [
    withOpen: fn mode: m do: block [
        | f |
        f := self open: fn mode: m.
        [block value: f] ensure: [f close].
    ]

    withOpen: fn1 mode: m1 and: fn2 mode: m2 do: block [
        | f1 f2 |
        f1 := self open: fn1 mode: m1.
        f2 := self open: fn2 mode: m2.
        [block value: f1 value: f2] ensure: [f1 close. f2 close].
    ]
]

Object subclass: Program [
    | input output corpus |

    arguments := LookupTable new
                 at: $c put: #corpus:;
                 at: $i put: #input:;
                 at: $o put: #output:;
                 yourself.
   
    corpus: filename [corpus := filename]
    input:  filename [input  := filename]
    output: filename [output := filename]

    run [
        | err cracker |
        err := false.
        Smalltalk arguments: '-c: -i: -o:'
                  do: [:name :arg | arguments
                                  at: name
                                  ifAbsent: [err := true]
                                  ifPresent: [:sel | self perform: sel with: arg].
                      ]
                  ifError: [^self usage].
        err ifTrue: [^self usage].
        corpus ifNil: [^self usage].
        input ifNil: [^self usage].
        output ifNil: [^self usage].
        
        cracker := CipherCracker new.
        FileStream withOpen: corpus
                   mode: FileStream read
                   do: [:f | f linesDo: [:l | cracker learn: l]].

        FileStream withOpen: input
                   mode: FileStream read
                   and: output
                   mode: FileStream write
                   do: [:in :out |
                        in linesDo: [:line | cracker prescan: line].
                        cracker beforeCrack.
                        in reset.
                        in linesDo: [:line | out << (cracker crack: line); nl]
                       ].
        cracker stats displayNl.
    ]

    usage [
        FileStream stderr << 'cracker.st -c CORPUS -i INPUT -o OUTPUT'; nl.
        ObjectMemory quit: 2
    ]
]

Program new run