local value = 5
local count = 3
local filled = {}
for index = 1, count do
filled[index] = value
end
-- filled = 5, 5, 5
-- One table put into every slot: three names
-- of the same object
local row = {}
local same_rows = {}
for index = 1, count do
same_rows[index] = row
end
same_rows[1][1] = 1
-- same_rows[3][1] = 1
-- A new table for every slot
local own_rows = {}
for index = 1, count do
own_rows[index] = {}
end
own_rows[1][1] = 1
-- own_rows[3][1] = nil
print("filled = " .. table.concat(filled, ", "))
print("same_rows[3][1] = "
.. tostring(same_rows[3][1]))
print("own_rows[3][1] = "
.. tostring(own_rows[3][1]))