#!/usr/bin/env lua local disk = require "disk" local eyes = require "eyes" local format = require "format" local reading = require "reading" local function mask (ring, index, value) local offset = (index - 1) % #ring if ring[offset + 1] == 0 then return value else return 0 end end for _, message in ipairs(eyes) do local values = {} for index, a, b, c in reading.trigrams(message) do a = mask(disk.eyes1, index, a) b = mask(disk.eyes2, index, b) c = mask(disk.eyes3, index, c) table.insert(values, reading.trigram_to_value(a, b, c)) end print(format.ascii32(values)) end