[ create a new paste ] login | about

Link: http://codepad.org/HlGajPjE    [ raw code | output | fork ]

nepta - Lua, pasted on Apr 7:
1
2
3
4
5
6
7
8
9
function f(n)
   local function f_(factorial,n)
      if n < 2 then return factorial end
      return f_(factorial*n, n-1)
   end
   return f_(1,n)
end

print(f(5))


Output:
1
120


Create a new paste based on this one


Comments: