local factorial
function factorial(n)
if (n == 1) then return 1
else
return factorial(n - 1) * n
end
end
print(factorial(5))
Sunday, May 13, 2012
recursive function 예 (forward declaration 사용)
Labels:
Lua
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment