lua game code
local grid = { { 11, 12, 13 }, { 21, 22, 23 }, { 31, 32, 33 } } for y, row in ipairs(grid) do for x, value in ipairs(row) do print(x, y, grid[y][x]) end end
lua code
-- While the code below IS lua, I think it's a bit hard to understand..- -- Another way to do it, without confusing yourself, is just doing it like this: local firstTable = {} firstTable.Apples = "Apple" firstTable.Bananas = "Banana" -- I'm adding new variables inside the table by using a dot, -- Seperating themselves from the table, and the variable! -- (A variable is something that can be used as a faster way to use values.. -- For instance, printing a string.) print(firstTable.Apples, firstTable.Bananas) -- IF YOU WANT TO DO IT FASTER vv local secondTable = {} secondTable.Apples = "Apples" secondTable.Bananas = "Bananas" local Apples, Bananas = secondTable.Apples, secondTable.Bananas print(Apples, Bananas)