summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/chickenize/chickenize.tex
blob: d1d211c572f4455f0bacfa4c7a57f98ad45d1fac (plain)
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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
%%
%% This is file `chickenize.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% chickenize.dtx  (with options: `tex')
%% 
%% EXPERIMENTAL CODE
%% 
%% This package is copyright © 2021 Arno L. Trautmann. It may be distributed and/or
%% modified under the conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version. This work has the LPPL mainten-
%% ance status ‘maintained’.
\directlua{dofile(kpse.find_file("chickenize.lua"))}

\def\ALT{%
  \bgroup%
  \fontspec{Latin Modern Sans}%
  A%
  \kern-.375em \raisebox{.65ex}{\scalebox{0.3}{L}}%
  \kern.03em \raisebox{-.99ex}{T}%
  \egroup%
}
\def\allownumberincommands{
  \catcode`\0=11
  \catcode`\1=11
  \catcode`\2=11
  \catcode`\3=11
  \catcode`\4=11
  \catcode`\5=11
  \catcode`\6=11
  \catcode`\7=11
  \catcode`\8=11
  \catcode`\9=11
}

\def\BEClerize{
  \chickenize
  \directlua{
    chickenstring[1]  = "noise noise"
    chickenstring[2]  = "atom noise"
    chickenstring[3]  = "shot noise"
    chickenstring[4]  = "photon noise"
    chickenstring[5]  = "camera noise"
    chickenstring[6]  = "noising noise"
    chickenstring[7]  = "thermal noise"
    chickenstring[8]  = "electronic noise"
    chickenstring[9]  = "spin noise"
    chickenstring[10] = "electron noise"
    chickenstring[11] = "Bogoliubov noise"
    chickenstring[12] = "white noise"
    chickenstring[13] = "brown noise"
    chickenstring[14] = "pink noise"
    chickenstring[15] = "bloch sphere"
    chickenstring[16] = "atom shot noise"
    chickenstring[17] = "nature physics"
  }
}

\def\boustrophedon{
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",boustrophedon,"boustrophedon")}}
\def\unboustrophedon{
  \directlua{luatexbase.remove_from_callback("post_linebreak_filter","boustrophedon")}}

\def\boustrophedonglyphs{
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",boustrophedon_glyphs,"boustrophedon_glyphs")}}
\def\unboustrophedonglyphs{
  \directlua{luatexbase.remove_from_callback("post_linebreak_filter","boustrophedon_glyphs")}}

\def\boustrophedoninverse{
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",boustrophedon_inverse,"boustrophedon_inverse")}}
\def\unboustrophedoninverse{
  \directlua{luatexbase.remove_from_callback("post_linebreak_filter","boustrophedon_inverse")}}

\def\bubblesort{
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",bubblesort,"bubblesort")}}
\def\unbubblesort{
  \directlua{luatexbase.remove_from_callback("bubblesort","bubblesort")}}

\def\chickenize{
  \directlua{luatexbase.add_to_callback("pre_linebreak_filter",chickenize,"chickenize")
    luatexbase.add_to_callback("start_page_number",
    function() texio.write("["..status.total_pages) end ,"cstartpage")
    luatexbase.add_to_callback("stop_page_number",
    function() texio.write(" chickens]") end,"cstoppage")
    luatexbase.add_to_callback("stop_run",nicetext,"a nice text")
  }
}
\def\unchickenize{
  \directlua{luatexbase.remove_from_callback("pre_linebreak_filter","chickenize")
    luatexbase.remove_from_callback("start_page_number","cstartpage")
    luatexbase.remove_from_callback("stop_page_number","cstoppage")}}

\def\coffeestainize{  %% to be implemented.
  \directlua{}}
\def\uncoffeestainize{
  \directlua{}}

\def\colorstretch{
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",colorstretch,"stretch_expansion")}}
\def\uncolorstretch{
  \directlua{luatexbase.remove_from_callback("post_linebreak_filter","stretch_expansion")}}

\def\countglyphs{
  \directlua{
             counted_glyphs_by_code = {}
             for i = 1,10000 do
               counted_glyphs_by_code[i] = 0
             end
             glyphnumber = 0 spacenumber = 0
             luatexbase.add_to_callback("post_linebreak_filter",countglyphs,"countglyphs")
             luatexbase.add_to_callback("stop_run",printglyphnumber,"printglyphnumber")
  }
}

\def\countwords{
  \directlua{wordnumber = 0
             luatexbase.add_to_callback("pre_linebreak_filter",countwords,"countwords")
             luatexbase.add_to_callback("stop_run",printwordnumber,"printwordnumber")
  }
}

\def\detectdoublewords{
  \directlua{
             luatexbase.add_to_callback("post_linebreak_filter",detectdoublewords,"detectdoublewords")
             luatexbase.add_to_callback("stop_run",printdoublewords,"printdoublewords")
  }
}

\def\dosomethingfunny{
    %% should execute one of the “funny” commands, but randomly. So every compilation is completely different. Maybe a list of commands could be specified to exclude total nonesense-functions. Maybe also on a per-paragraph-basis?
}

\def\dubstepenize{
  \chickenize
  \directlua{
    chickenstring[1] = "WOB"
    chickenstring[2] = "WOB"
    chickenstring[3] = "WOB"
    chickenstring[4] = "BROOOAR"
    chickenstring[5] = "WHEE"
    chickenstring[6] = "WOB WOB WOB"
    chickenstring[7] = "WAAAAAAAAH"
    chickenstring[8] = "duhduh duhduh duh"
    chickenstring[9] = "BEEEEEEEEEW"
    chickenstring[10] = "DDEEEEEEEW"
    chickenstring[11] = "EEEEEW"
    chickenstring[12] = "boop"
    chickenstring[13] = "buhdee"
    chickenstring[14] = "bee bee"
    chickenstring[15] = "BZZZRRRRRRROOOOOOAAAAA"

    chickenizefraction = 1
  }
}
\let\dubstepize\dubstepenize

\def\explainbackslashes{ %% inspired by xkcd #1638
  {\tt\noindent
\textbackslash escape character\\
\textbackslash\textbackslash line end or escaped escape character in tex.print("")\\
\textbackslash\textbackslash\textbackslash real, real backslash\\
\textbackslash\textbackslash\textbackslash\textbackslash line end in tex.print("")\\
\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash elder backslash \\
\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash backslash which escapes the screen and enters your brain\\
\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash backslash so real it transcends time and space \\
\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash backslash to end all other text\\
\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash... the true name of Ba'al, the soul-eater}
}

\def\francize{
  \directlua{luatexbase.add_to_callback("pre_linebreak_filter",francize,"francize")}}

\def\unfrancize{
  \directlua{luatexbase.remove_from_callback("pre_linebreak_filter",francize)}}

\def\gameoflife{
  Your Life Is Tetris. Stop Playing It Like Chess.
}
\def\gameofchicken#1{\directlua{
GOCrule_live = {2,3}
GOCrule_spawn = {3}
GOCrule_antilive = {2,3}
GOCrule_antispawn = {3}
GOCcellcode = "\\scalebox{0.03}{\\drawchicken}"
GOCcellcode = "\\scalebox{0.03}{\\drawcov}"
GOCx = 100
GOCy = 100
GOCiter = 150
GOC_console = false
GOC_pdf = true
GOCsleep = 0
GOCdensity = 100
#1
gameofchicken()

if (GOCmakegif == true) then
  luatexbase.add_to_callback("wrapup_run",make_a_gif,"makeagif")
end
}}
\let\gameofchimken\gameofchicken % yeah, that had to be.

\def\guttenbergenize{ %% makes only sense when using LaTeX
  \AtBeginDocument{
    \let\grqq\relax\let\glqq\relax
    \let\frqq\relax\let\flqq\relax
    \let\grq\relax\let\glq\relax
    \let\frq\relax\let\flq\relax
    \gdef\footnote##1{}
    \gdef\cite##1{}\gdef\parencite##1{}
    \gdef\Cite##1{}\gdef\Parencite##1{}
    \gdef\cites##1{}\gdef\parencites##1{}
    \gdef\Cites##1{}\gdef\Parencites##1{}
    \gdef\footcite##1{}\gdef\footcitetext##1{}
    \gdef\footcites##1{}\gdef\footcitetexts##1{}
    \gdef\textcite##1{}\gdef\Textcite##1{}
    \gdef\textcites##1{}\gdef\Textcites##1{}
    \gdef\smartcites##1{}\gdef\Smartcites##1{}
    \gdef\supercite##1{}\gdef\supercites##1{}
    \gdef\autocite##1{}\gdef\Autocite##1{}
    \gdef\autocites##1{}\gdef\Autocites##1{}
    %% many, many missing … maybe we need to tackle the underlying mechanism?
  }
  \directlua{luatexbase.add_to_callback("pre_linebreak_filter",guttenbergenize_rq,"guttenbergenize_rq")}
}

\def\hammertime{
  \global\let\n\relax
  \directlua{hammerfirst = true
             luatexbase.add_to_callback("pre_linebreak_filter",hammertime,"hammertime")}}
\def\unhammertime{
  \directlua{luatexbase.remove_from_callback("pre_linebreak_filter","hammertime")}}

\let\hendlnize\chickenize     % homage to Hendl/Chicken
\let\unhendlnize\unchickenize % may the soldering strength always be with him

\def\italianizerandwords{
  \directlua{luatexbase.add_to_callback("pre_linebreak_filter",italianizerandwords,"italianizerandwords")}}
\def\unitalianizerandwords{
  \directlua{luatexbase.remove_from_callback("pre_linebreak_filter","italianizerandwords")}}

\def\italianize{
  \directlua{luatexbase.add_to_callback("pre_linebreak_filter",italianize,"italianize")}}
\def\unitalianize{
  \directlua{luatexbase.remove_from_callback("pre_linebreak_filter","italianize")}}


\def\kernmanipulate{
  \directlua{luatexbase.add_to_callback("pre_linebreak_filter",kernmanipulate,"kernmanipulate")}}
\def\unkernmanipulate{
  \directlua{lutaexbase.remove_from_callback("pre_linebreak_filter",kernmanipulate)}}

\def\leetspeak{
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",leet,"1337")}}
\def\unleetspeak{
  \directlua{luatexbase.remove_from_callback("post_linebreak_filter","1337")}}

\def\leftsideright#1{
  \directlua{luatexbase.add_to_callback("pre_linebreak_filter",leftsideright,"leftsideright")}
  \directlua{
    leftsiderightindex = {#1}
    leftsiderightarray = {}
    for _,i in pairs(leftsiderightindex) do
      leftsiderightarray[i] = true
    end
  }
}
\def\unleftsideright{
  \directlua{luatexbase.remove_from_callback("pre_linebreak_filter","leftsideright")}}

\def\letterspaceadjust{
  \directlua{luatexbase.add_to_callback("pre_linebreak_filter",letterspaceadjust,"letterspaceadjust")}}
\def\unletterspaceadjust{
  \directlua{luatexbase.remove_from_callback("pre_linebreak_filter","letterspaceadjust")}}

\def\listallcommands{
  \directlua{
 for name in pairs(tex.hashtokens()) do
     print(name)
 end}
}

\let\stealsheep\letterspaceadjust     %% synonym in honor of Paul
\let\unstealsheep\unletterspaceadjust
\let\returnsheep\unletterspaceadjust

\def\matrixize{
  \directlua{luatexbase.add_to_callback("pre_linebreak_filter",matrixize,"matrixize")}}
\def\unmatrixize{
  \directlua{luatexbase.remove_from_callback("pre_linebreak_filter","matrixize")}}

\def\milkcow{     %% FIXME %% to be implemented
  \directlua{}}
\def\unmilkcow{
  \directlua{}}

\def\medievalumlaut{
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",medievalumlaut,"medievalumlaut")}}
\def\unmedievalumlaut{
  \directlua{luatexbase.remove_from_callback("post_linebreak_filter","medievalumlaut")}}

\def\pancakenize{
  \directlua{luatexbase.add_to_callback("stop_run",pancaketext,"pancaketext")}}

\def\rainbowcolor{
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",randomcolor,"rainbowcolor")
             rainbowcolor = true}}
\def\unrainbowcolor{
  \directlua{luatexbase.remove_from_callback("post_linebreak_filter","rainbowcolor")
             rainbowcolor = false}}
\let\nyanize\rainbowcolor
\let\unnyanize\unrainbowcolor

\def\randomchars{
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",randomchars,"randomchars")}}
\def\unrandomchars{
  \directlua{luatexbase.remove_from_callback("post_linebreak_filter","randomchars")}}

\def\randomcolor{
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",randomcolor,"randomcolor")}}
\def\unrandomcolor{
  \directlua{luatexbase.remove_from_callback("post_linebreak_filter","randomcolor")}}

\def\randomerror{ %% FIXME
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",randomerror,"randomerror")}}
\def\unrandomerror{ %% FIXME
  \directlua{luatexbase.remove_from_callback("post_linebreak_filter","randomerror")}}

\def\randomfonts{
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",randomfonts,"randomfonts")}}
\def\unrandomfonts{
  \directlua{luatexbase.remove_from_callback("post_linebreak_filter","randomfonts")}}

\def\randomuclc{
  \directlua{luatexbase.add_to_callback("pre_linebreak_filter",randomuclc,"randomuclc")}}
\def\unrandomuclc{
  \directlua{luatexbase.remove_from_callback("pre_linebreak_filter","randomuclc")}}

\def\relationship{%
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",cutparagraph,"cut paragraph")
    luatexbase.add_to_callback("stop_run",missingcharstext,"charsmissing")
    relationship()
  }
}

\let\rongorongonize\boustrophedoninverse
\let\unrongorongonize\unboustrophedoninverse

\def\scorpionize{
  \directlua{luatexbase.add_to_callback("pre_linebreak_filter",scorpionize_color,"scorpionize_color")}}
\def\unscorpionize{
  \directlua{luatexbase.remove_from_callback("pre_linebreak_filter","scorpionize_color")}}

\def\spankmonkey{    %% to be implemented
  \directlua{}}
\def\unspankmonkey{
  \directlua{}}

\def\substitutewords{
  \directlua{luatexbase.add_to_callback("process_input_buffer",substitutewords,"substitutewords")}}
\def\unsubstitutewords{
  \directlua{luatexbase.remove_from_callback("process_input_buffer","substitutewords")}}

\def\addtosubstitutions#1#2{
  \directlua{addtosubstitutions("#1","#2")}
}

\def\suppressonecharbreak{
  \directlua{luatexbase.add_to_callback("pre_linebreak_filter",suppressonecharbreak,"suppressonecharbreak")}}
\def\unsuppressonecharbreak{
  \directlua{luatexbase.remove_from_callback("pre_linebreak_filter","suppressonecharbreak")}}

\def\tabularasa{
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",tabularasa,"tabularasa")}}
\def\untabularasa{
  \directlua{luatexbase.remove_from_callback("post_linebreak_filter","tabularasa")}}

\def\tanjanize{
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",tanjanize,"tanjanize")}}
\def\untanjanize{
  \directlua{luatexbase.remove_from_callback("post_linebreak_filter","tanjanize")}}

\def\uppercasecolor{
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",uppercasecolor,"uppercasecolor")}}
\def\unuppercasecolor{
  \directlua{luatexbase.remove_from_callback("post_linebreak_filter","uppercasecolor")}}

\def\upsidedown#1{
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",upsidedown,"upsidedown")}
  \directlua{
    upsidedownindex = {#1}
    upsidedownarray = {}
    for _,i in pairs(upsidedownindex) do
      upsidedownarray[i] = true
    end
  }
}
\def\unupsidedown{
  \directlua{luatexbase.remove_from_callback("post_linebreak_filter","upsidedown")}}

\def\variantjustification{
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",variantjustification,"variantjustification")}}
\def\unvariantjustification{
  \directlua{luatexbase.remove_from_callback("post_linebreak_filter","variantjustification")}}

\def\zebranize{
  \directlua{luatexbase.add_to_callback("post_linebreak_filter",zebranize,"zebranize")}}
\def\unzebranize{
  \directlua{luatexbase.remove_from_callback("post_linebreak_filter","zebranize")}}
\newattribute\leetattr
\newattribute\letterspaceadjustattr
\newattribute\randcolorattr
\newattribute\randfontsattr
\newattribute\randuclcattr
\newattribute\tabularasaattr
\newattribute\uppercasecolorattr

\long\def\textleetspeak#1%
  {\setluatexattribute\leetattr{42}#1\unsetluatexattribute\leetattr}

\long\def\textletterspaceadjust#1{
  \setluatexattribute\letterspaceadjustattr{42}#1\unsetluatexattribute\letterspaceadjustattr
  \directlua{
    if (textletterspaceadjustactive) then else % -- if already active, do nothing
      luatexbase.add_to_callback("pre_linebreak_filter",textletterspaceadjust,"textletterspaceadjust")
    end
    textletterspaceadjustactive = true         % -- set to active
  }
}
\let\textlsa\textletterspaceadjust

\long\def\textrandomcolor#1%
  {\setluatexattribute\randcolorattr{42}#1\unsetluatexattribute\randcolorattr}
\long\def\textrandomfonts#1%
  {\setluatexattribute\randfontsattr{42}#1\unsetluatexattribute\randfontsattr}
\long\def\textrandomfonts#1%
  {\setluatexattribute\randfontsattr{42}#1\unsetluatexattribute\randfontsattr}
\long\def\textrandomuclc#1%
  {\setluatexattribute\randuclcattr{42}#1\unsetluatexattribute\randuclcattr}
\long\def\texttabularasa#1%
  {\setluatexattribute\tabularasaattr{42}#1\unsetluatexattribute\tabularasaattr}
\long\def\textuppercasecolor#1%
  {\setluatexattribute\uppercasecolorattr{42}#1\unsetluatexattribute\uppercasecolorattr}
\def\chickenizesetup#1{\directlua{#1}}
\long\def\luadraw#1#2{%
  \vbox to #1bp{%
    \vfil
    \latelua{pdf_print("q") #2 pdf_print("Q")}%
  }%
}
\long\def\drawchicken{
  \luadraw{90}{
    chickenhead     = {200,50} % chicken head center
    chickenhead_rad = 20

    neckstart = {215,35} % neck
    neckstop  = {230,10} %

    chickenbody     = {260,-10}
    chickenbody_rad = 40
    chickenleg = {
      {{260,-50},{250,-70},{235,-70}},
      {{270,-50},{260,-75},{245,-75}}
    }

    beak_top = {185,55}
    beak_front = {165,45}
    beak_bottom = {185,35}

    wing_front = {260,-10}
    wing_bottom = {280,-40}
    wing_back = {275,-15}

    sloppycircle(chickenhead,chickenhead_rad) sloppyline(neckstart,neckstop)
    sloppycircle(chickenbody,chickenbody_rad)
    sloppyline(chickenleg[1][1],chickenleg[1][2]) sloppyline(chickenleg[1][2],chickenleg[1][3])
    sloppyline(chickenleg[2][1],chickenleg[2][2]) sloppyline(chickenleg[2][2],chickenleg[2][3])
    sloppyline(beak_front,beak_top) sloppyline(beak_front,beak_bottom)
    sloppyline(wing_front,wing_bottom) sloppyline(wing_back,wing_bottom)
  }
}
\long\def\drawcov{
  \luadraw{90}{
    covbody = {200,50}
    covbody_rad = 50

    covcrown_rad = 5
    crownno = 13
    for i=1,crownno do
      crownpos = {covbody[1]+1.4*covbody_rad*math.sin(2*math.pi/crownno*i),covbody[2]+1.4*covbody_rad*math.cos(2*math.pi/crownno*i)}
      crownconnect = {covbody[1]+covbody_rad*math.sin(2*math.pi/crownno*i),covbody[2]+covbody_rad*math.cos(2*math.pi/crownno*i)}
     sloppycircle(crownpos,covcrown_rad)
     sloppyline(crownpos,crownconnect)
   end

    covcrown_rad = 6
    crownno = 8
    for i=1,crownno do
      crownpos = {covbody[1]+0.8*covbody_rad*math.sin(2*math.pi/crownno*i),covbody[2]+0.8*covbody_rad*math.cos(2*math.pi/crownno*i)}
      crownconnect = {covbody[1]+0.5*covbody_rad*math.sin(2*math.pi/crownno*i),covbody[2]+0.5*covbody_rad*math.cos(2*math.pi/crownno*i)}
      sloppycircle(crownpos,covcrown_rad)
      sloppyline(crownpos,crownconnect)
    end

    covcrown_rad = 8
    sloppycircle(covbody,covcrown_rad)
    sloppycircle(covbody,covbody_rad)
    sloppyline(covbody,covbody)
  }
}
\long\def\drawhorse{
  \luadraw{90}{
    horsebod = {100,-40}
    sloppyellipsis(horsebod,50,20)
    horsehead = {20,0}
    sloppyellipsis(horsehead,25,15)
    sloppyline({35,-10},{50,-40})
    sloppyline({45,5},{80,-25})
    sloppyline({60,-50},{60,-90})
    sloppyline({70,-50},{70,-90})
    sloppyline({130,-50},{130,-90})
    sloppyline({140,-50},{140,-90})
    sloppyline({150,-40},{160,-60})
    sloppyline({150,-38},{160,-58})
    sloppyline({150,-42},{160,-62})
    sloppyline({-5,-10},{10,-5})
    sloppyellipsis({30,5},5,2)  %% it's an eye, aye?
    sloppyline({27,15},{34,25})
    sloppyline({34,25},{37,13})
  }
}
\long\def\drawfathorse{
  \luadraw{90}{
    horsebod = {100,-40}
    sloppyellipsis(horsebod,50,40)
    horsehead = {20,0}
    sloppyellipsis(horsehead,25,15)
    sloppyline({35,-10},{50,-40})
    sloppyline({45,5},{70,-15})
    sloppyline({60,-70},{60,-90})
    sloppyline({70,-70},{70,-90})
    sloppyline({130,-70},{130,-90})
    sloppyline({140,-70},{140,-90})
    sloppyline({150,-40},{160,-60})
    sloppyline({150,-38},{160,-58})
    sloppyline({150,-42},{160,-62})
    sloppyline({-5,-10},{10,-5})
    sloppyellipsis({30,5},5,2)  %% it's an eye, aye?
    sloppyline({27,15},{34,25})
    sloppyline({34,25},{37,13})
  }
}
\long\def\drawunicorn{
\color{pink!90!black}
  \drawhorse
  \luadraw{0}{
    sloppyline({15,20},{15,50})
    sloppyline({15,50},{25,20})
  }
}
\long\def\drawfatunicorn{
\color{pink!90!black}
  \drawfathorse
  \luadraw{0}{
    sloppyline({15,20},{15,50})
    sloppyline({15,50},{25,20})
  }
}
%% 
%%
%% End of file `chickenize.tex'.