Public
Remixed
Starter template with client-side React & Hono server
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

🎡 Idiom Wheel

A Wheel of Fortune–style, one-turn idiom guessing game. Each round picks a random three-word phrase, reveals about 30% of its letters, and hides the rest as blank tiles. You get a single guess (case-insensitive) — then the answer is revealed and you can play again.

How to play

  1. A random three-word idiom is loaded with ~30% of letters showing.
  2. Type the full phrase and hit Guess.
  3. Right or wrong, the answer is shown. Hit Play again for a fresh round.

Architecture

Rendering mermaid diagram...

File structure

index.ts                      ← Hono backend: serves frontend + /api routes
idioms.ts                     ← The list of three-word phrases
puzzle.ts                     ← Puzzle generation (~30% reveal) + guess checking
frontend/
  index.html                  ← HTML shell (Twind + React)
  index.tsx                   ← React entrypoint
  components/
    App.tsx                   ← Root layout
    Game.tsx                  ← Game state, input, result, "play again"
    Board.tsx                 ← Renders the revealed/blank letter tiles

How it works

  • /api/new picks a random phrase, reveals ~30% of its letters, and returns the masked board plus an opaque base64 token of the answer. The full answer is never sent in plaintext until the round ends.
  • /api/guess decodes the token server-side and compares it to the player's guess after normalizing (lowercase, collapse whitespace, strip punctuation), so matching is case-insensitive and forgiving.

Customizing

Add or edit phrases in idioms.ts. Tweak the reveal percentage via REVEAL_FRACTION in puzzle.ts.