function sum(a)
local sum = 0
for i, v in pairs(a) do
sum = sum + v
end
return sum
end
local a = {10, 20, 30, 40}
print(sum(a))
키워드 : 함수
Thursday, May 3, 2012
function 사용 예
Labels:
Lua
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment