Initial commit

This commit is contained in:
mid
2026-05-04 21:04:23 +03:00
commit 037d18e9fd
9 changed files with 1484 additions and 0 deletions

41
set.lua Normal file
View File

@@ -0,0 +1,41 @@
local function equal(a, b)
for k in pairs(a) do
if not b[k] then
return false
end
end
for k in pairs(b) do
if not a[k] then
return false
end
end
return true
end
local function min(s)
local a
for b in pairs(s) do
if not a or b < a then
a = b
end
end
return a
end
local function max(s)
local a
for b in pairs(s) do
if not a or a < b then
a = b
end
end
return a
end
local function merge(to, from)
for k in pairs(from) do
to[k] = true
end
end
return {equal = equal, min = min, max = max, merge = merge}