From 5002bee1413a0dcb886a51619282504dd49b3aeb Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 20 Nov 2024 23:49:25 +0100 Subject: Calculate absolute delta in mod 83 body --- delta-wrap.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 delta-wrap.lua (limited to 'delta-wrap.lua') diff --git a/delta-wrap.lua b/delta-wrap.lua new file mode 100755 index 0000000..d63beeb --- /dev/null +++ b/delta-wrap.lua @@ -0,0 +1,16 @@ +#!/usr/bin/env lua +local eyes = require "eyes" +local format = require "format" +local reading = require "reading" +for _, message in ipairs(eyes) do + local previous = 0 + local deltas = {} + for _, value in reading.values(message) do + if value <= previous then + previous = previous - 83 + end + table.insert(deltas, value - previous) + previous = value + end + print(format.csv(deltas)) +end -- cgit v1.1