mediumReact Native#137

Stroop Color Game (Juego de Colores)

Prompt

Implement the logic functions for a Stroop-effect color game.

Write two functions:

  1. getRound(round) — returns { word, displayColor }
    • word: the color NAME to display (changes each round)
    • displayColor: a different color to render it in (tricky!)
  2. handleChoice(chosen, state) — returns { score, round, gameOver }
    • chosen: the button the user tapped
    • state: { score, round } — current state
    • Increment score if chosen matches the word, advance round
    • End game after 20 rounds

Live Preview

Round 1/20 · Score 0

Hints

Solution

Your Code

15 min

Tests

Click Run to test your code