NPR puzzle

Ro Nagey aloharo at gmail.com
Wed Jul 20 14:30:56 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

Apologies in advance if you get this twice - the first one got held  
up because it was too long


More information about the use-livecode mailing list