Skip to content

Instantly share code, notes, and snippets.

@kaworun
Created January 23, 2013 06:35
Show Gist options
  • Save kaworun/4602625 to your computer and use it in GitHub Desktop.
Save kaworun/4602625 to your computer and use it in GitHub Desktop.
-- for
for i = 0, 9 do
print(i)
end
-- for table
a = {10, 20, "hoge"}
b = {name = "huga", age = 17}
for i, value in ipairs(a) do
print(i, value)
end
for key, value in pairs(b) do
print(key, value)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment