NPR puzzle

Ro Nagey aloharo at gmail.com
Wed Jul 20 14:51:34 EDT 2005


Here's my humble submission:

on doIt
   put the ticks into startTime
   put fld "element" into gorp
   repeat for each line l in fld "words"
     put "Yes" 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
         put "No" into myAnswer
         exit repeat
       end if
     end repeat
     if myAnswer contains "Yes" then put myWord & return after  
finalAnswer
   end repeat
   put the ticks-startTime into totalTicks
   answer totalTicks && finalAnswer && the number of lines in  
finalAnswer
end doIt

Did it in 2 ticks and found 23 words :)

Ro Nagey

Sorry if you get this 3 times - but I haven't received the ones sent  
earlier and am thinking something in there triggered spam detectors  
or something. :)



More information about the use-livecode mailing list