Questions tagged as 'lua'

1
answer

Compile using the Terminal in Lua

I'm now initializing studies of the Lua programming language, but I'm having a hard time, when I make a program in c to compile the algorithm in the terminal I write: **gcc nome-do-programa.c** and then put **./a.out**...
asked by 25.02.2016 / 23:04
2
answers

What is the difference between 'local function var' and 'local var = function ...'?

There are two ways to declare a local function directly. local var = function() end; and local function var() end What's the difference between them?     
asked by 27.01.2017 / 23:17
1
answer

implode PHP in LUA

I have the following code that passes a php array to JS: var js_array_date1 = [<?php echo '"'.implode('","', $newarray_date1).'"' ?>]; My problem is how can I do this in LUA. Passing an LUA array to JS, I know I have to use table.c...
asked by 14.05.2015 / 11:51
2
answers

How do I remove the thousandths of a value?

For example number=10.123456 How do I remove the thousandths of number so that it is only 10.12 ? Please help me     
asked by 02.01.2017 / 21:32
1
answer

Symbol; on the Moon [closed]

How does the ; symbol on the moon work? ;;;; ; ; do ; end; do ;end do ;end; do;end; ;do end ;do end; ;do ; end; ;;do ; end do end     
asked by 26.01.2017 / 23:31
2
answers

What is the # in the language Lua?

I'm watching this tutorial about creating a game and I came across something I did not understand about it of the language Lua. There is an excerpt of the code where the following expression exists: ents.objects[#ents.objects] What doe...
asked by 08.12.2015 / 18:25
1
answer

Calculate from x in x seconds

I have this code that calculates in 1 second in 1 second between a certain time and then insert into a table. Instead of calculating every 1 second, how can I calculate, for example, every 5 seconds? for y = horaInicial, horaFinal-1 do hor...
asked by 18.02.2015 / 16:28
1
answer

Read table in Lua through C ++

I have a table in Lua like this: myTable={ one = {a=1, b=2, c=3}, two = {a=4, b=2, c=1} } The file has already been loaded, how do I read the table data through C ++?     
asked by 21.03.2015 / 08:06
1
answer

Replace text inside tag

I'm trying to replace within a tag? EX: mystr = '<html><head></head><body><p>Aqui meu texto</p></body></html>' mystr = mystr:gsub('<.+>', '') print(mystr) I would like it to return: Aq...
asked by 13.01.2015 / 14:07
1
answer

Read LUA file

I have a file that I want to read only a few lines, not all lines. I get by GET the lines I want to read, which are numbers. I can only read the entire file. local inicio = GET["inicio"] local fim = GET["fim"] local f = io.open(ficheiro, "r" )...
asked by 06.02.2015 / 10:56