Scripting competition

Sarah Reichelt sarah.reichelt at gmail.com
Mon May 11 22:48:01 EDT 2009


On Tue, May 12, 2009 at 11:35 AM, Jerry J <jhj at jhj.com> wrote:
>> From: Mark Wieder <mwieder at ahsoftware.net>
>>
>> ROTFL. Maybe I should have specified that you have to arrive at the
>> correct answer...
>
> I get digests, so I bet somebody beat me to it.
> This gives the right answers, I think...
>
> into your message box:
> go URL "http://jhjensen.com/calcFibs.rev"
>

Jerry, this seems to give the same correct results as Brian's does,
but I noticed it was rather slow.
Checking your script, you update the display in the field every time
through the loop.
I realise this was just a quick hack stack but this is generally a bad
technique.

It is vastly better to assemble all the data into a variable and only
put it into the field once.
By making that change, I got the running time for your script down
from 1022 milliseconds to 21!

Cheers,
Sarah



More information about the use-livecode mailing list