Jacque,
How about using the 'difference' command? Here's a simple example:
on mouseUp
put "true" into tDict["test"]
put "true" into tDict["word"]
put "true" into tDict["ball"]
put "test" & cr & "ball" & cr & "boat" & cr & "unicorn" into tUserWords
split tUserWords by cr and tab
difference tUserWords with tDict
if tUserWords is not an array then
answer "All words matched!"
else
answer "Sorry, try again, these words didn't match:" & cr & cr & (the
keys of tUserWords)
end if
end mouseUp
If you run this, it will say that "boat" and "unicorn" don't match; if
tUserWords is "test" and "ball" you get "all words matched".
Will this work?
Ken
> On Mar 3, 2022, at 2:34 PM, J. Landman Gay via use-livecode
> <[email protected]> wrote:
>
> On 3/3/22 2:00 PM, Tom Glod via use-livecode wrote:
>> But what prevents you from loading all your data into an array? and just
>> iterating over the keys or index of an array? vs the lines of a long list.?
>> That will yield the fastest performance.
>
> Right, it's an array, and I don't iterate. I just check the array key
> directly for a value.
>
> I realize I'm kind of monopolizing things here. I wrote the game for myself
> and I ignored the speed issues and just played it on my tablet where it works
> fine, but now someone else wants to include it in a distributed app so I need
> to figure it out.
>
> --
> Jacqueline Landman Gay | [email protected]
> HyperActive Software | http://www.hyperactivesw.com
>
> _______________________________________________
> use-livecode mailing list
> [email protected]
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
Ken Ray
Sons of Thunder Software, Inc.
Email: [email protected]
Website: https://www.sonsothunder.com
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode