lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Dec 30, 2010 at 10:37:41PM +0200, jgiors@threeeyessoftware.com wrote:
> What Steve wrote had a typo (missing keyword "then"), but was 
> otherwise correct. It should have been this:
> 
> local fact
> function fact(n)
>     if n == 2 then return 2 else return n*fact(n-1) end
> end
> 
Alas, no.  Try that code for n=0 and n=1.

The rest of your post deals with things that others have already
responded to.

Dirk