NPR puzzle

Ro Nagey aloharo at gmail.com
Wed Jul 20 15:00:50 EDT 2005


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.
>




More information about the use-livecode mailing list