Prompt
Implement the logic functions for a Stroop-effect color game.
Write two functions:
getRound(round)— returns { word, displayColor }word: the color NAME to display (changes each round)displayColor: a different color to render it in (tricky!)
handleChoice(chosen, state)— returns { score, round, gameOver }chosen: the button the user tappedstate: { 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