Heya,
I am just trying out some of the code in programming in Lua. I know there are bound to be differences in Corona. I am trying one of the first bits of sample code,
-- 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))
and I am getting an error which says, “attempt to perform arithmetic on local ‘n’ (a nil value)”.
I’m on a windows 7 machine, running the code in the free edition of the Corona sdk simulator.
Any insight would be appreciated - thanks!