Difference between revisions 41828 and 41830 on zhwikivoyage-- defines a factorial function
function fact (n)
if n == 0 then
return 1
else
return n * fact(n-1)
end
end
print("enter a number:")
a = io.read("*number") -- read a number
print(fact(a))https://www.mediawiki.org/wiki/Lua/Tutorial
local p = {}
function p.hello(frame)
return 'Hello'
end
return p
This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|