#make a spellcheck
9 messages · Page 1 of 1 (latest)
you could either include a word database in your included files and then load it on gamestart or simply hardcode it in a script (altho the first part is better overall)
you could split for lines and read every word by itself
var file = file_text_open_read(working_directory + "yourwordlist.txt")
global.words = []
while !file_text_eof(file)
{
array_push(global.words, file_text_readln(file));
}
file_text_close(file);
loading would roughly look like that
if you make a text file that's just all the words comma-separated, you can load the whole string onto a variable, then use string_split to separate it into an array
can also have a json which is just 1 array, then load the json wholesale and boom you have an array
Thank you very much
may I suggest my own library? Looks like a good match.
https://github.com/Homunculus84/Binder
alternatively, if all you need is prefix + full word matching from a sorted list, you could just grab the binary search script from the docs.
If all you need is checking a word exists / doesn’t exist, a struct is enough