summaryrefslogtreecommitdiff
path: root/doc/context/third/enigma/examples/enigma-example-context.tex
blob: 769c608d378774c306cdd80f3392d4726055f9d7 (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
\usemodule [enigma]
\usetypescript [iwona]
\setupbodyfont [iwona,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