Post code tricks here!
SuicidalSTDz 02 Apr 2013
Imgoodisher 03 Apr 2013
With this bit of code:
local tbl = setmetatable({}, { __index = function(self, index) if not rawget(self, index) then rawset(self, index, {}) else return rawget(self, index) end end })you can have a 2-dimensional table without worrying about setting (for example) tbl[1] before setting tbl[1][5]. You could probably also put the code inside itself to make 3D tables... metatableception?
theoriginalbit 03 Apr 2013
PixelToast 03 Apr 2013
Imgoodisher, on 03 April 2013 - 01:22 PM, said:
also put the code inside itself to make 3D tables... metatableception?
anyway heres your metatableception:
rawset(self,index,setmetatable({},getmetatable(self))
i used a bit of that here