I literally went on for about 600 words to hit a search engine optimization goal without realizing I could expand on how I actually made the game’s most important file: the word list. (As an aside, I have no idea why 600 words is the minimum that I needed to hit, but the algorithms are inscrutable so I follow the best-guess advice.).

Anyways, the word list is actually another bit of code, but this, I didn’t follow a specific guide. I wrote a something in Python with the help of people on the Internet with similar questions to me (I don’t know what the file of code is called; I code as a hobby that I’m trying to monetize).

You might wonder why I chose Python, and the answer would be that’s the programming language I’m most comfortable in using, which is not great when building online word games purely in JavaScript, but I digress.

If you haven’t tried out the game yet, go do so and improve my website’s engagement metrics: https://www.skilltest.us/palabrale-spanish-word-game/

Allegedly, I do get additional search engine points for including links throughout my website and to other ones; I get more points if websites link to my work, but unless I’m going to run a bunch of websites specifically to game that system, I will not be able to get those ones. Maybe via Pinterest and reddit? I can at least try Pinterest since that’s easy and constantly recommended.

Starting Point: A Spanish Word List for a Spanish Word Game

To start with building out my word list, I went looking for one that already existed; I was attempting not to do unnecessary work. After a quick google search, I found this one on github: https://github.com/words/an-array-of-spanish-words/tree/master.

There was just a slight problem (there were actually more problems later with my using this list): the list contained words longer and shorter than the five characters that the guide I was following assumed. It took about thirty minutes and some more googling (I’m not actually sure if I was using a browser that defaulted to google or a different search engine), but I managed to create the following code to convert the github json file of Spanish words into a json file of Spanish words that are exactly five characters long.

More importantly, the code worked, and you can tell that it’s personal code because I didn’t add any comments to remind myself why I was doing any of it. Is it the most optimized? I have no idea, but it only needed to work once, which it did.

import json

with open('Locally saved File Name and Folder Path from github') as fd:

allSpanishWords = json.load(fd)

wordleWords = []

for i in range(len(allSpanishWords)):
	if len(allSpanishWords[i]) == 5:
		wordleWords.append(allSpanishWords[i])
	else:
		pass

print(len(wordleWords))

with open(File Name and Path for filtered word list, 'w', encoding='utf-8') as f:

json.dump(wordleWords, f, ensure_ascii=False, indent=4)

print("File created")

The Problem with the Word List for the Word Game

After fiddling around with the code for a bit (and frequently breaking the game), I couldn’t get it to recognize ñ as a valid character, so I removed it. While going to remove any word containing ñ, I realized I probably left every word that contained accent marks, a thing my game is definitely not designed to accept as valid inputs. Eventually, I’ll figure out how to fix that, but in the mean time, I wouldn’t want the word to be literally unguessable.

Once again, other online people already having a similar issue allowed for an easy fix; I just had to update my code slightly. For ease (and to get more search engine points for post length), the updated code can be found below.

Q&A Digression with Myself

Should I attempt to gain more points by explaining it in painstaking detail? Yes

Will I? No, or at least not yet; maybe I’ll want those points in the future

The New Code for The New List for the Same Game

import json

with open('Locally saved File Name and Folder Path from github') as fd:

allSpanishWords = json.load(fd)

wordleWords = []

for i in range(len(allSpanishWords)):
	if len(allSpanishWords[i]) == 5 and not("ñ" in allSpanishWords[i]) and allSpanishWords[i].isalpha():
		wordleWords.append(allSpanishWords[i])
	else:
		pass

print(len(wordleWords))

with open(File Name and Path for filtered word list, 'w', encoding='utf-8') as f:

json.dump(wordleWords, f, ensure_ascii=False, indent=4)

print("File created")

Looking at this code again, another way you can tell it’s written by an amateur is the fact that I know that some type of character is meant to indicate when it’s a new line, but I have no idea what that character is or when I’d use it. So I didn’t. Conveniently, the code works without me observing that convention.