CodeNewbie Community 🌱

Shawn Daugherty Calhoun
Shawn Daugherty Calhoun

Posted on

In urgent need of JS advice!

Urgent JS coding advice needed for job seeker!

Hey folks,
I have a question and don't know where to ask it.
I'm a Techdegree grad facing the arduous task of interview coding challenges. I flubbed my first challenge a little, but have made it to round 2 of this particular employers challenge. The challenge is to build a Wordle like game. The it appears as if they want to compare the guessed words to the input received from a JS prompt box. The only way I can think to code this is by actually building a game board and actually capturing the text content to compare values. A nice version of an HTML/CSS/JS version is here:

I think the potential employer is asking for a much simpler version. I know how to capture the input from the prompt box, but don't know how I would evaluate each character to give a user feedback is to the positions as shown below. The senior programmer here stated they wrote a simple version in Ruby to evaluate answers. I really want this job! A nudge in the right direction would be greatly appreciated!!!!
Employer's directions below.

Implement a version of the game Wordle. Here's how to play.

A player will have 6 chances to guess a 5-letter word. After each
guess, the user will receive feedback that indicates which letters
they guessed correctly and whether or not those letters were in the
correct position. Here's an example transcript of a game, with notes
added after the double-slashes.

Please guess a 5 letter word. // Just a message.

steal // prompt the user for input, which in this case is "steal"
_ _ e _ _ // "e" is in the correct position, the other letters are unknown
reeds // prompt for input again
(r) _ e _ _ // "r" is in the word, but wrong position
_ _ e r y // three correct letters in the correct positions
Great job! // success!

Top comments (2)

khloeabrown profile image
Khloe Brown

Hello, Hello 👋 What a coincidence seeing wordle on my social feeds today.

Coder Coder just released this video: Live coding a WORDLE clone (5 hrs) | HTML Sass JS

Here's the link. It's a 5-hour tutorial. Good Luck and Best Wishes!

lfosgett profile image
Lauren Fosgett

I'm not great with javascript but I think if you're trying to really simplify this, you could parse over the input string and assign different text colors to the letters instead of creating different colored tiles.