Multidimensional array in Moon

1

I'm trying to insert an array inside a multidimensional ... Example:

local info = {
  [1] = {name = Felipe, idade = 21, rua = Alvorada},
  [2] = {name = Carlos, idade = 23, rua = Lima},
  [3] = {name = Sabrina, idade = 19, rua = Principal}
}

local cidades = {
  ['Central'] = {info[1], info[2], info[3]}
}

I tried every way to my knowledge, I used loops for and while, and I did not find a solution, where am I going?

I did it this way and it worked!
cidades = {}
cidades['Central'] = {}
for i = 1, #info do
   cidades['Central'][i] = info[i]
end
    
asked by anonymous 24.08.2018 / 00:25

0 answers