Guessthechar: A guess the missing letter game
Published on under the Coding category. Toggle Memex mode
I love words, especially the feeling I get when I see a word for the first time. Perhaps fueled by the feeling of excitement I get when I see new words for the first time, I used to have a "word of the day" that I shared with friends. I would choose the word of the day based on what I had heard or read in the previous day. I now have a word of the day on my website.
Today, I was thinking about ideas for a word game. I was interested in a game that would challenge my recall of words. I decided to build Guessthechar, a game wherein you are given words with one missing letter. You are challenged to fill in the missing letter in each word. Ten words are presented. You must fill in the missing letters as fast as possible. To explore the idea, I made a proof-of-concept in Python.
If you are interested in playing the game, check out the project on GitHub.
How the game works
Guessthatcar uses the "count_1w.txt" dataset distributed by Peter Norvig. This dataset is derived from the Google Web Trillion Word Corpus. The dataset contains "the 1/3 million most frequent words, all lowercase, with counts".
The page on which the dataset is advertised for download was last updated on November 22nd, 2011. It is unclear exactly when the dataset was last updated, but suffice to say it is a few years out of date. With that said, this was not a hindrance to the game. The chance of being popular words from 10 years ago appearing in the game adds a twist.
When you load the game, the dataset is downloaded. You can choose a difficulty level: easy, medium, or hard. These difficulty levels determine the percentile of words by count that can be used in the game. The easy mode can select words from the top 95% percentile of words for the game. If you choose the hard setting, any word from the top 80th percentile can show up. I determined this percentile to be sufficiently difficult for an advanced setting of the game.
Ten words are chosen. A letter is removed from each word. You have to fill in each missing letter as fast as possible. Here is an excerpt of words from a few games, picked to show the diversity in words that can show up:
Guess the letter: thriv_ng i
Correct!
Guess the letter: cauti_n o
Correct!
Guess the letter: orch_rds a
Correct!
Guess the letter: star_ucks b
Correct!
Guess the letter: walth_m o
Incorrect!
The correct word was: waltham
Guess the letter: broad_asting c
Correct!
Guess the letter: banglades_i h
Correct!
My guesses are the letters at the end of each line.
In the above excerpts, common words like "thiriving" appear. There are brands, like "Starbucks". The dataset is not a corpus of dictionary words; it is a vast array of words used on the English-language web when the dataset was published.
When you have completed a game, you get a score, and the time it took you to complete the game:
Your score: 8
Time taken: 16.52s
Avg time per word: 1.65s
I have been having a lot of fun with this game. Sometimes, words are easy to identify. Other times, I need to think for a second or two. On some occasions, I need to type a random letter, knowing I am not going to get the answer because I am entirely unsure what letter could go in the blank space.
One thought on my mind is how I could synthesize the score and time taken to create a single number that represents how well you did. I'm not sure how I would do this yet, though. I would also like to turn this into a web application one day.
Responses
Comment on this post
Respond to this post by sending a Webmention.
Have a comment? Email me at readers@jamesg.blog.
