Word O Longo — Two‑Player Prefix Duel


Objective

  • Players alternately extend their current prefix using letter buttons. If a player’s prefix cannot lead to any dictionary word, the game auto‑completes the longest possible word for them and ends their turn.
  • After both complete, points are awarded by word length.

Dictionary & search

  • Word list: Loaded from a static text file and upper‑cased for consistent matching.
  • Prefix pruning: Each move filters the remaining candidate words for the active player and computes:
    • Remaining count of valid continuations.
    • Maximum achievable length from the current prefix (displayed live).

Flow & UI

  • Shared alphabet buttons appear only on the active side. A score top bar tracks rounds and totals. Players can “surrender” their turn to force auto‑completion.
  • Visual feedback highlights the active player and pulses prefixes on updates.

Implementation notes

  • The game maintains per‑player state (prefix, candidates, final word, score). Efficient prefix filtering avoids recomputing the full dictionary each step.

Next steps

  • Add timed turns, per‑round random starting letters, penalties for dead‑ends, or bonus themes (animals, foods) using curated sub‑dictionaries.