Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,17 @@
-- This concept is relevant to tables in Lua
local table1 = {1,2,3}
-- The following will create a table of references to table1
local refTab = {}
for i = 1, 10 do refTab[i] = table1 end
-- Instead, tables should be copied using a function like this
function copy (t)
local new = {}
for k, v in pairs(t) do new[k] = v end
return new
end
-- Now we can create a table of independent copies of table1
local copyTab = {}
for i = 1, 10 do copyTab[i] = copy(table1) end