summaryrefslogtreecommitdiff
path: root/macros/context/contrib/context-enigma/doc/context/third/enigma/examples/enigma-example-context.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/context/contrib/context-enigma/doc/context/third/enigma/examples/enigma-example-context.tex')
-rw-r--r--macros/context/contrib/context-enigma/doc/context/third/enigma/examples/enigma-example-context.tex59
1 files changed, 59 insertions, 0 deletions
diff --git a/macros/context/contrib/context-enigma/doc/context/third/enigma/examples/enigma-example-context.tex b/macros/context/contrib/context-enigma/doc/context/third/enigma/examples/enigma-example-context.tex
new file mode 100644
index 0000000000..051e719697
--- /dev/null
+++ b/macros/context/contrib/context-enigma/doc/context/third/enigma/examples/enigma-example-context.tex
@@ -0,0 +1,59 @@
+\usemodule [enigma]
+%\usetypescript [computer-modern-unicode]
+%\setupbodyfont [computer-modern-unicode,20pt]
+%\usetypescript [iwona]
+%\setupbodyfont [iwona,20pt]
+\usetypescript [modern]
+\setupbodyfont [modern,20pt]
+
+\defineenigma [nilsettings]
+\setupenigma [nilsettings] [ %% a machine with vanilla settings
+ other_chars = no,
+ day_key = I II III 01 01 01,
+ rotor_setting = aaa,
+ spacing = yes,
+ verbose = 3,
+]
+
+\defineenigma [othernilsettings] [nilsettings]
+
+\defineenigma [secretmessage]
+\setupenigma [secretmessage] [
+ other_chars = yes,
+ day_key = B V III II 12 03 01 GI JV KZ WM PU QY AD CN ET FL,
+ rotor_setting = ben,
+]
+
+\defineenigma [othersecretmessage] [secretmessage]
+
+\defineenigma [othermessage] [secretmessage]
+\setupenigma [othermessage] [other_chars=wrong]
+
+\starttext
+
+\placefigure{Enigma output and its reversal using nil settings}{
+ \framed [width=.7\hsize,frame=off,align=middle]{
+ \startnilsettings
+ aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aa
+ \stopnilsettings
+
+ \startothernilsettings
+ bdzgo wcxlt ksbtm cdlpb muqof xyhcx tgyjf linhn xs
+ \stopothernilsettings
+ }
+}
+
+\startsecretmessage
+ føo bąr baž
+\stopsecretmessage
+
+\startothersecretmessage
+ iøtyąwqiž
+\stopothersecretmessage
+
+\startothermessage
+ føo bąr baž
+\stopothermessage
+
+\stoptext
+% vim:ft=context:tw=71:ts=2:sw=2:expandtab