Word games

Hard
·
90 minutes

Prompt

Wordle is an amazing word game and you should play it right now!

The premise is simple: every day there's a new five-letter secret word, and the user has to guess it. They have six tries, and with every try they get some feedback on each letter of the submitted word:

  • If the letter is present in the word, it will be highlighted yellow
  • If the letter is present in the word AND in the correct position, it will be highlighted green
  • If the letter is not present in the word, it will be greyed out

The user wins if they correctly guess the word within six tries.

You'll be implementing a basic version of the original Wordle game, with the following requirements:

  • User can enter guesses via the input
  • User can submit a guess by pressing ENTER while focused on the input
  • User receives feedback on a guess in the form of highlighted letters (see description above)
  • User should see how many guesses they have remaining
  • If the user correctly guesses within six tries, user should receive a success message: "You correctly guessed the word in N tries!"
  • If the user does not correctly guess within six tries, user should be informed what the word was: "The word was '______'"
  • Repeat letters in both the word and guess should be handled correctly
  • Submissions with repeat letters should provide valid feedback (e.g. daily word='baring', submitted word='abbey', the 'a' and the first 'b' should be highlighted yellow)

API endpoints

Get the word of the day

Check if a word is in the 5-letter word dicrionary

Submitting solutions

  1. Create a solution by forking one of our CodePen templates:
  2. Submit your solution here

Hints

Additional challenges

Get future questions delivered straight to your inbox for free

Sign up and receive instant access to new questions when we publish them.

We‘ll only use your information to deliver new questions and to provide you updates about our product. We‘ll never spam you or sell your information without your consent. Unsubscribe at any time.