Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return function()
- local s = {
- values = {};
- }
- s.push = function(val)
- table.insert(s.values,1,val)
- end
- s.pop = function()
- return table.remove(s.values,1)
- end
- s.peek = function()
- return s.values[1]
- end
- s.empty = function()
- return #s.values == 0
- end
- return s
- end
Advertisement
Add Comment
Please, Sign In to add comment