Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = {} -- déclaration d'une table 'a'
- local x = 20 -- déclaration d'une variable locale 'x'
- for i = 1, 10 do
- local y = 0 -- déclaration d'une nouvelle variable locale
- -- et interne à la boucle for ... end
- a[i] = function() y = y + 1; return x + y end
- print("i = "..i.." (x + y) = "..x + y)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement