Jump to content

Module:Sandbox/sameboat2

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Sameboat (talk | contribs) at 05:25, 19 March 2013. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
my_object = {};
function factorial(n)
    if n == 0 then
      return 1 --this returns the result 1 when passed zero
    else
      return n * factorial(n - 1)
    end
  end
  for index = 1,54 do
      my_object.hello = function( frame )
      return index, "n! = ", factorial(index) 
      end
  end
return my_object