¿Qué significa # en Lua?
He visto que el carácter hash '#' se agrega mucho al frente de las variables en Lua.
¿Qué hace?
EJEMPLO
-- sort AIs in currentlevel
table.sort(level.ais, function(a,b) return a.y < b.y end)
local curAIIndex = 1
local maxAIIndex = #level.ais
for i = 1,#currentLevel+maxAIIndex do
if level.ais[curAIIndex].y+sprites.monster:getHeight() < currentLevel[i].lowerY then
table.insert(currentLevel, i, level.ais[curAIIndex])
curAIIndex = curAIIndex + 1
if curAIIndex > maxAIIndex then
break
end
end
end
Disculpas si esto ya se ha pedido, he buscado mucho en Internet, pero parece que no he encontrado una respuesta. ¡Gracias por adelantado!