rf-web/vendor/bundle/gems/rouge-3.12.0/lib/rouge/demos/lua
2019-10-21 10:18:17 +02:00

13 lines
214 B
Plaintext

-- 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))