Add Lua code for chapter 3

This commit is contained in:
zhangjiong
2017-08-08 17:19:38 +08:00
committed by Aditya Bhargava
parent 88840a470f
commit 525ff6c314
3 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
function fact(x)
if x <= 1 then
return 1
else
return x * fact(x - 1)
end
end
print(fact(5))