Menu
[ ← back to blog ]

Simple word guessing game in JS

A simple JavaScript word guessing game spec: how words are chosen, how letters are hidden, and how scoring and remaining guesses drive the game loop.

javascriptgameweb-developmentprojecttutorial

You can play it [here]({{ site.url | append: ‘/GuessTheWord/’ }}).

Specification

This is a simple word guessing game. It is intended to focus on the logic rather than the game itself. Only 50 words are included and answers that are not included in these 50 words are considered to be incorrect. The guessing word is selected randomly from these 50 words repeatedly. And for each guessing word, no more than half its letters are chosen randomly to be hidden for the player to guess.

You can find all words here.

Three components are recorded in the game board.

ComponentDescription
Your current scoreInitially zero and will be incremented by one if you guess one word right.
Incorrect guessesInitially zero and incremented by one when you submited a worng answer.
Remaining guessesInitially ten and decremented by one when you submited a wrong answer. The game is meant to be over when no remaining guesses are left. And at that time, the game board will be resumed to the current state and a new game is restarted

PW
Paul Wen
Replied just now
Hello! Thanks for reaching out.
I'm currently open to new opportunities. How would you like to connect?