a wordle clone, for when you NEED to have another wordle NOW
There are two files — a server (HTTP API) written in Flask (app.py
) and the web application front-end code (templates/index.html
) written in Vue.js.
The flask website uses a unique, client-generated ID to keep track of games. The Vue application receives full game state on every request, and uses this to rerender the game board and keyboard as appropriate.
The list of common words in common5.txt
was derived from this page, filtering on five-letter words. I manually removed proper nouns as I found them, and truncated the list to the first (i.e., most common) 1000 or so words.
The complete wordlist (all valid guess words) was generated using:
import json
# https://github.com/barrust/pyspellchecker/blob/master/spellchecker/resources/en.json.gz
all_words = json.load(open('en.json'))
all_words_len_five = [
word for word in all_words.keys() if len(word) == 5
]
with open("wordlist.txt", "w") as f:
for word in all_words_len_five:
f.write(word + "\n")