lua

Return file data.moon in PHP in array form

I need to access some data stored in a file .lua in PHP. This is the contents of the file meu_arquivo.lua: tbl = { [22 ... As much as it bears a resemblance to the JSON , the json_decode function did not work for this file. Any help is welcome!

Can anyone explain to me what is a generic Moon tie?

I already know the ties while,repeat and for, but when I was looking at the types of loops, in the section I found the SUCH of the" generic for Loop". The text was in English.

Vector ordering

I'm learning about vectors and matrices, and I haven't been able to solve a question in the right way for quite some time. T ... end end CriarVetor() Ordenar() ReOrdenar() for b=1, tamanho do print("A posicao "..b.." do vetor vale: "..vetor[b]) end

how lua (corona sdk) runs on android

I'm testing the Corona sdk for android, and I'm finding it pretty good. Of course they are simple tests, but it ran very wel ... ava or is it a C++ port for android? I made a program similar to the Android sdk in java, and it doesn't seem to run faster.

How to use a moon variable in C++?

I can't get value from an array in Lua to use in C++. So I get the value of the variable M: //No LUA M = 85 //No C+ ... s below: // LUA MATRIZ = { {4,2,2,6}, {2,1,1,2}, {2,1,1,2}, {5,2,2,3} } How to get the value of this array?

How to add directories to module search in Lua?

I'm having a problem with the require function, I want it to look for a lua file, but I don't want to specify the folder, and ... nt specify the folder because on someone else's computer will not work, why the folder has a different name, so how can I do?

How to locate a file without specifying folder / drive in bat or lua?

How to locate a file and save it in a variable? I will use it for reading (this part is already solved), however, I want to ... e it would not succeed, since the folder name/path / directories, they wouldn't be the same. How to do this in bat or moon ?

Lua data names and types

About names and data types in the Lua language. What is the maximum size of a name? Is it allowed to define enumeration, sub-range, record, and union types? I did not find this information in the documentation.

Can one create variables within a block and use them afterwards?

do local a2 = 2*a local d = sqrt(b^2 - 4*a*c) x1 = (-b + d)/a2 x2 = (-b - d)/a2 end -- scope of `a2' and `d' ends here print(x1, x2)

What is the difference between "in pairs" and "in ipairs" in Lua?

produtos = { arroz = 10, feijao = 15 } for produtos, valor in pairs(produtos) do print(produtos .. " custa R$" . ... valor) end Returns: feijao custa R$15 arroz custa R$10 But when I use "ipairs" instead of" pairs", it returns nothing.

String contains certain word

I would like to check if a string contains a certain word. String = "oi\ntchau\nhi\nbye" The string is divided by \n (Skip line), I would like to check between each line, if it contains the whole word, I have tried and still could not.

How to print accents on Moon

I'm starting to learn Moon now, and I can't print accents print("Olá mundo") Returns Ol├í mundo In both VS Code terminal and powershell, is there a way to fix this?