bnz2 at cdc.gov
Thu Jul 21 08:33:18 CDT 2005
When I tried conjoining the if-then statement like that, both with 'or'
and with 'and' I found it to be 2 to 3 milliseconds slower than separate
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of Jim Hurley
Sent: Wednesday, July 20, 2005 6:43 PM
To: use-revolution at lists.runrev.com
Subject: Re: NPR puzzle
>Date: Wed, 20 Jul 2005 14:52:50 -0500
>From: "Glenn E. Fisher" <gefisher at mac.com>
>Subject: Re: NPR puzzle
>To: How to use Revolution <use-revolution at lists.runrev.com>
>Message-ID: <8425930f6dbe22c95c747155f706c649 at mac.com>
>Content-Type: text/plain; charset=US-ASCII; format=flowed
>Here is my submission that ran in 70 milliseconds on my 5 1/2 year old
>G4 450 MHz tower:
> set cursor to watch
> put the milliseconds into t
> put fld "ChemSymbols" into c
> put fld "dictionary" into d
> repeat for each line L in d
> if c contains char 1 to 2 of L and c contains char 3 to 4 of L\
> and c contains char 5 to 6 of L and c contains char 7 to 8 of L\
> and c contains char 9 to 10 of L then
> put L & CR after o
> end if
> end repeat
> put the milliseconds -t into t
> put o into fld "Output"
> put "time=" & t && "msecs" after fld "Output"
At first I thought it would be slower than the one that most of us
opted for, i.e. test each condition sequentially and if the test
fails at any level go on with a "next repeat".
I thought RR would test all the conditionals in your handler (in
...and ... and...) before moving on to the next repeat, but Scott
Raney was too smart for that. Apparently, at the point where the
"and" test fails, RR decides there is no point in proceeding with
the others, so...... next repeat.
The speed is about the same for either method.
P.S. If you submit your solution to NPR and your name is drawm, you
are in danger of being called on Sunday for another test of wits. My
mind works too slowly for this kind of exposure.
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
More information about the use-livecode