lua loop function code example
Example 1: lua for loop
-- For K,V in table
for k,v in pairs(tbl) do
print(k)
print(v)
end
-- For i=0, num
for i=0, num do
print(i)
end
Example 2: lua how to make a loop
for init,max/min value, increment
do
statement(s)
end
Example 3: for loop lua
local t = {}
for key, value in pairs(t) do
print(key, value)
end