mediumReact Native#135

Word Guessing Game (Adivinar Pokemon)

Prompt

Implement the logic for a Hangman-style word guessing game.

Write three pure functions:

  1. getDisplay(word, guessed) — returns the word with unguessed letters as underscores (e.g. "P _ K A _ H U")
  2. processGuess(letter, state) — processes a letter guess, returns new { guessed, wrong, gameOver, won }
  3. isGameOver(state) — returns { won: boolean, lost: boolean }

The word is "PIKACHU", max 6 wrong guesses.

Live Preview

_ _ _ _ _ _ _ _ _ _

Hints

Solution

Your Code

15 min

Tests

Click Run to test your code