NPR puzzle
Lynch, Jonathan
bnz2 at cdc.gov
Wed Jul 20 15:09:24 EDT 2005
Interesting - so 'is not in' was actually faster than lineoffset! Is
that always the case?
What if you use this:
If matchtext(Gorp,AnElement) = false then...
-----Original Message-----
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of Ro Nagey
Sent: Wednesday, July 20, 2005 3:01 PM
To: How to use Revolution
Subject: Re: NPR puzzle
No - you way times out in 43-45 milliseconds -
Here's the latest version of my code - it comes in around 36-37
milliseconds.
on doIt
put the milliseconds into startTime
put fld "element" into gorp
put fld "words" into allwords
repeat for each line l in allwords
put "Y" into myAnswer
put l into myWord
put myWord into daWord
repeat 5 times
put char 1 to 2 of daWord into anElement
delete char 1 to 2 of daWord
if anElement is not in gorp then
--If lineoffset(anElement,Gorp) = 0 then
put empty into myAnswer
exit repeat
end if
end repeat
if myAnswer is "Y" then put myWord & return after finalAnswer
end repeat
put the milliseconds-startTime into totalTicks
answer totalTicks && finalAnswer
end doIt
Ro Nagey
PS My spam filter is apparently censoring the mail I write ... feel
free to insert whimsical observation here :)
On Jul 20, 2005, at 7:51 PM, Lynch, Jonathan wrote:
> Hi Ro...
>
> Would your script go faster if you used lineoffset rather than 'is not
> in'?
>
> If lineoffset(anElement,Gorp) = 0 then...
>
>
> I ask because I am not which method is faster in which circumstances.
>
_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list