Help with a logistical problem

DISCLAIMER - I put this in scripting support because I wasn’t sure if it would fit in any other category.

I’m currently working on a word game called “Ghost”, which is based on the real-life version of the game.

Ghost explanation, in case you don't know.

Basically, everyone gets in a circle (or in this case, the game), and someone says the first letter. You then go down the perimeter of the circle and every next person says a letter of the word. Nobody knows what everyone else is trying to spell, but you have to continue the word with a letter that makes sense.

If you’re the person who says the last letter of the word, the next person in line can get you out. If someone doesn’t know what word is being spelled, they can bluff and say a random letter that might make sense to the next person in line. If the next person catches this, they can ask them “What word are you trying to spell?”, and if the first person would be out.

I was heavily inspired by the games “WTW - What’s the word?” and “Word Bomb”.

Links

WTW - here
Word Bomb - here

I found a searching algorithm that can be used to search through massive tables to find a specific entry. I already have this setup, and now I just need the table.

I was planning on just having a table with every single English word. But this is where the logistical problem comes in. I’ve found a website that has every single word in English here.

The issue is that I don’t know how to get all of those words into the table with the proper formating. I’m hoping someone might be able to help me with this unless I want to write an AutoHotkey script and run it for hours on end to syntax it all.

Here’s what I mean:

Proper syntax -

local foo = 
{
"word1",
"word2",
"word3",
...
}

Improper syntax, which is where I’m at now. -

local foo = 
{
word1
word2
word3
...
}

If anyone has any other suggestions on what I should do besides putting a bunch of English words into a table, please inform me of that too!

2 Likes

I think putting every English word into a table would be a bit excessive, however you could put them together in a string and use string.split to separate words based on a space or a comma. Hope this helps!

1 Like

You could use an HTTP database that contains every word along with the API if given :slight_smile:

2 Likes

That is true and would save plenty of space, however it may be hard to manage words you may want to censor. I’m sure there are a lot of words you would have to remove to ensure your game doesn’t get reported, which is one of the reasons I wouldn’t upload the entire english dictionary.

1 Like

Then how would I go about this? I’m hoping to reach something similar to what WTW and Word Bomb has.

1 Like

You could set it up similar to this:

local words = "Word1,Word2,Word3,Word4"
words = string.split(words,",")

words will now be a table of all of the words you want. I would suggest going through and removing problematic words instead of using HTTP.

1 Like

You can do this using regex in VSCode. Do find and replace using ctrl + H and then replace \n with “,\n”
You can also do this in Studio, but it’s not working for me for some reason.

EDIT: Here’s the file words.txt (757.0 KB)

3 Likes

I feel like censoring words will be the least of concerns. You can always use Roblox’s FilteringAsync to censor every word, especially considering you will probably loop through every word that you are given. You can also add a blacklisted words table if this is a problem as well, but it should only be used when you plan on censoring a small portion of words.

I checked the website, there aren’t any inappropriate words besides some words that have multiple meanings like female dog and things like that. Thanks for the suggestion for FilteringAsync, I’ll probably still use that just in case I’ve missed anything.

1 Like