Fun project but fuzzy on logic. "PhoneCALLs"

Geoff Canyon gcanyon at
Sun Sep 21 13:01:01 EDT 2003

I'm not ;-)

Untested, but this would do it I think, trimming the recursion at the 
first point where it doesn't match. This assumes that the word list has 
a leading return, and the output now has a leading cr instead of a 
trailing cr:

local sSolution -- the output results of good words
local sWordList -- the list of good words. must have leading cr

on mouseUp
   put empty into sSolution
   doPerms cr,"2345678"
   put sSolution into fld 1
end mouseUp

on doPerms pString,pPhone
   if pString is not in sWordList then exit doPerms -- pruning here
   if pPhone is empty then
     put pString after sSolution
     put char 1 of pPhone into tChar
     delete char 1 of pPhone
     repeat for each char c in item tChar of 
       doPerms (pString & c),pPhone
     end repeat
   end if
end doPerms

On Sunday, September 21, 2003, at 07:18  AM, Rob Cozens wrote:

>> A recursive solution would handle this nicely:
> Geoff, et al:
> Where are you checking to see the combinations of characters in 
> sSolution are legal words?
> -- 
> Rob Cozens
> CCW, Serendipity Software Company
> "And I, which was two fooles, do so grow three;
> Who are a little wise, the best fooles bee."
> from "The Triple Foole" by John Donne (1572-1631)
> _______________________________________________
> use-revolution mailing list
> use-revolution at


Geoff Canyon
gcanyon at

More information about the Use-livecode mailing list