add utils, use luajit which seems faster

This commit is contained in:
Felix Van der Jeugt 2021-12-05 12:10:59 +01:00
parent 87637a4682
commit fad5da2e27
No known key found for this signature in database
GPG key ID: 58B209295023754D
5 changed files with 33 additions and 25 deletions

View file

@ -1,15 +1,4 @@
function split(text, sep)
local parts = {}
local start = 0
local from, to = text:find(sep)
while from ~= nil do
table.insert(parts, text:sub(start, from - 1))
text = text:sub(to + 1)
from, to = text:find(sep)
end
table.insert(parts, text)
return parts
end
require("utils")
local f = io.open(arg[3])
local numbers = split(f:read("*l"), ",")