Divergent/mods/Anomaly Magazines Redux/gamedata/scripts/stack.script

17 lines
304 B
Plaintext
Raw Normal View History

2024-03-17 20:18:03 -04:00
function push(table, value)
table[#table + 1] = value
end
function pop(table)
if #table > 0 then
local value = table[#table]
table[#table] = nil
return value
else
return nil
end
end
function peek(table)
return #table == 0 and nil or table[#table]
end