This commit is contained in:
nazrin 2025-05-23 15:41:23 +00:00
commit d2743fe41d
22 changed files with 2290 additions and 0 deletions

17
lib/util.lua Normal file
View file

@ -0,0 +1,17 @@
local Util = {}
function Util.indexOf(haystack, needle)
for b,blade in pairs(haystack) do
if blade == needle then return b end
end
end
function Util.getNext(stack, item, d)
local w = Util.indexOf(stack, item)
if not w then return nil end
local i = (((w-1) + d) % #stack) + 1
return stack[i]
end
return Util