diff options
author | Aki <please@ignore.pl> | 2024-11-07 18:28:16 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2024-11-07 18:28:16 +0100 |
commit | 2eee005702d1be7e0391399f203cdbd9d7d5a42a (patch) | |
tree | b4f8068a06ce198b70764e94169d1bd420e1d94f /machine.lua | |
parent | 7a57438f8f6d30a8fe490e87f6f24c70847d2530 (diff) | |
download | noita-eyes-2eee005702d1be7e0391399f203cdbd9d7d5a42a.zip noita-eyes-2eee005702d1be7e0391399f203cdbd9d7d5a42a.tar.gz noita-eyes-2eee005702d1be7e0391399f203cdbd9d7d5a42a.tar.bz2 |
Sketch of Patrick's simplified automaton/cipher mechanism
Document: https://docs.google.com/document/d/1EwnCgP4eq1g_M2iZObSDZdhV3fFoZ0RXRBXWrUm-hw0
Discord: https://discord.com/channels/453998283174576133/1063583558154854521/1303784643342106645
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 |