Word finder logic / code


I need some help :).
An example of what I’m trying to do.
Type the letters “pla” and get all the words from a wordlist.txt file starting with the letters “pla”.
Play, player etc.
Or in a more advanced version, get all the words with “pla” letters.
Play, player, complaint etc.

So far I can get all the words from the wordlist.txt file, insert them in a table and using table.indexOf() check if I have an exact match.
Meaning that if I type the word “player” I can get a message using print() that the word exist in the wordlist.txt file and if I type “playermn” that he word doesn’t exist.

It’s for a tool that will help me with a game I’m working on!

It wasn’t that complicated after all.
I did it with string.find()


1 Like

If you are incorporating this in an app, you’ll still need to tackle real-time searches that don’t hang the interface.

You might find this interesting:



Nice! Thank you @roaminggamer!