summaryrefslogtreecommitdiff
path: root/format.lua
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2024-11-02 13:41:36 +0100
committerAki <please@ignore.pl>2024-11-02 13:41:36 +0100
commit0b0e02875dbc4d7d795cafe6e5720aa66b32e1ac (patch)
treee42c905d5d1ddde4c1bb1cf58fbf7d697c17616e /format.lua
parent1a2c8b663ed89b4d4a75463e28260a7c4955ecb1 (diff)
downloadnoita-eyes-0b0e02875dbc4d7d795cafe6e5720aa66b32e1ac.zip
noita-eyes-0b0e02875dbc4d7d795cafe6e5720aa66b32e1ac.tar.gz
noita-eyes-0b0e02875dbc4d7d795cafe6e5720aa66b32e1ac.tar.bz2
Naive approach to disk-based masking directly on the trigrams
Diffstat (limited to 'format.lua')
-rw-r--r--format.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/format.lua b/format.lua
new file mode 100644
index 0000000..3a126a9
--- /dev/null
+++ b/format.lua
@@ -0,0 +1,22 @@
+local format = {}
+
+
+function format.csv (tvalues)
+ local str = string.format("%d", tvalues[1])
+ for i=2, #tvalues do
+ str = str .. string.format(",%d", tvalues[i])
+ end
+ return str
+end
+
+
+function format.ascii32 (tvalues)
+ local str = ""
+ for _, value in ipairs(tvalues) do
+ str = str .. string.char(32 + value)
+ end
+ return str
+end
+
+
+return format