WordleLoading saved progress…

Wordle

Build Wordle: guess a 5-letter word in six tries, with per-letter color feedback after each guess — green for the right letter in the right spot, yellow for a letter that's in the word but misplaced, grey for absent. The subtle part is the coloring algorithm: it must handle duplicate letters correctly, which takes two passes.

Signature

type Score = 'correct' | 'present' | 'absent';
function scoreGuess(guess: string, answer: string): Score[];

// A self-contained component. No props.
function App(): JSX.Element;

Examples

answer = REACT, guess = TRACE →
  T present · R present · A correct · C present · E present
answer = REACT, guess = EERIE →
  only ONE E is colored (answer has one E); the extra E's are absent

Notes

  • Two-pass scoring. First pass marks exact matches and consumes those letters; second pass marks present from what's left.
  • Duplicate handling. Track remaining letter counts so a guess can't "use" a letter more times than it appears.
  • Keyboard input. Letters append to the current row; Backspace deletes; Enter submits a full 5-letter row.
  • Six guesses. Win on an exact match; after six wrong guesses, reveal the answer.
WE’RE LISTENING

Help make UIReady better

Found a bug or have an idea? Tell us about it.

Up to 3 files · 5 MiB each · JPG, PNG, WebP, MP4, WebM, MP3, M4A or WAV