simple loop for lua 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: for loop lua
for x = 0, 10, 1 do
print(x)
end
-- 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
for x = 0, 10, 1 do
print(x)
end