Hello MIT,
From what I found on Google recursion should be possible in App Inventor 2. However, when I try even simple examples like recursively calculating the factorial of a number, I always end up with an "undefined" runtime error. Attached is a tiny example (screen-shot and project file). For sake of completeness:
Factorial(x) :=
1 for x <= 0 (forgive my laziness not handling x<0 as mathematically undefined in this example :)
x * Factorial(x-1) for x>0
Is this a known issue or am I doing something wrong?
Regards
Sven
P. S. Of course I know that I could easily calculate the factorial of a number by iteration avoiding recursion (as every recursion can be translated into an iteration). It's just an example! :)
*** using AI2 in Firefox 32.0.3 on Win7 with a Samsung Galaxy S2 connected via Wifi as test device ***