Skip to content

Instantly share code, notes, and snippets.

@stravant
Created August 8, 2021 06:21
Show Gist options
  • Save stravant/f2ffa88a9d494866390cbee7eb05b42c to your computer and use it in GitHub Desktop.
Save stravant/f2ffa88a9d494866390cbee7eb05b42c to your computer and use it in GitHub Desktop.
local rowMT = {
__index = function(tb, key)
local col = {}
tb[key] = col
return col
end,
}
local grid = setmetatable({}, {
__index = function(tb, key)
local row = setmetatable({}, rowMT)
tb[key] = row
return row
end,
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment