Difference between revisions 41766 and 41828 on zhwikivoyage

prepend "f = mw.getCurrentFrame()"
local p = {}
function p.hello( frame )
return "Hello, world!"
end
mw.log(p.hello(f-- 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))