Speed up a slow loop
J. Landman Gay
jacque at hyperactivesw.com
Sat Mar 5 23:12:55 EST 2022
Interesting idea. There are 25 letters on each board, some are always repeats. I think I'd need
a good regex so I wouldn't have to run the filter command multiple times. How's your regex?
On the other hand, I suppose filtering out even just 2 or 3 letters might make a dent. I'll try
that first.
On 3/5/22 8:36 PM, Quentin Long via use-livecode wrote:
>
> So… a Boggle game. Hm. Seems to me that anything you can do to reduce the number of words you need consider at any given time would be a win. Maybe not a *big* win, but still a win. So perhaps give this idea a shot:
>
> When you create a new board:
>
> -- Make a list of all the letters which *are not* on the board
>
>
> -- Filter out any word that contains at least one letter on the "not on this board" list
>
> -- Use the thus-reduced wordlist for all purposes as long as the board doesn't change
>
> This would add a bit of overhead to the process of setting up a new board, but if it results in time savings during play, the extra overhead might be worthwhile anyway.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list