On Wed, Feb 12, 2014 at 10:41 PM, Mark Wieder <mwie...@ahsoftware.net>wrote:
> Close. Your first array element is empty. Right answer, though. > What's in the array isn't important, really -- it's just a manual form of the memo feature some languages offer. fibArray[1] is empty, as is fibArray[0], because the function short-cuts both of those arguments and simply returns them. I literally went online and searched "recursive fibonacci function" and copy-pasted, then added the memo feature. I think it's more honest to do that, since the exact function isn't really the point. In a sense, applying memo might be considered a cheat, since the point was that LC performance could be improved. Finding a clever way to patch over LC's lack of tail-recursion optimization or memo isn't really the point, but I thought it was valid here to mention that the thing that (I assume) makes javascript faster than LC might be built-in on the JS side, but can be replicated pretty simply on the LC side. _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode