diff options
Diffstat (limited to 'machine.lua')
-rwxr-xr-x | machine.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/machine.lua b/machine.lua new file mode 100755 index 0000000..44f7146 --- /dev/null +++ b/machine.lua @@ -0,0 +1,16 @@ +#!/usr/bin/env lua +local eyes = require "eyes" +local reading = require "reading" +for _, message in ipairs(eyes) do + local cip = require"automaton""abcdefghijklm opqrstuvxyz" + local str = "" + for index, a, b, c in reading.trigrams(message) do + cip = cip:apply(a):apply(b):apply(c) + local slot = 3 + if (index - 1) % 3 == 1 then + slot = 19 + end + str = str .. cip[slot] + end + print(str) +end |