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.
A word-search game where hidden words are placed on a grid as snake-paths (each word winds through king-adjacent cells — horizontal, vertical, or diagonal). Some cells are left empty. Your only clues are how many words are hidden and their lengths.
Drag your finger/mouse from letter to letter to trace a path. A guess is accepted only if it matches where a word was actually placed — spelling a word that merely exists in the dictionary, or exists elsewhere on the grid, doesn't count. This is enforced server-side: the browser never sees the solution.
Rendering mermaid diagram...
backend/generatePuzzle.ts— picks random words from thewordsdictionary table and lays each one as a self-avoiding snake-path via backtracking DFS. Words never share cells; unused cells stay empty.backend/store.ts— persists each generated puzzle (including the exact placed paths) in SQLite so the server can validate guesses. The client only receives letters + clues.index.ts— Hono HTTP server. Routes:POST /api/puzzle→ new puzzle (grid + word-length clues, no solution)POST /api/check→{ id, path }; accepted only ifpathexactly matches a placed word's cells (forward or reversed)GET /api/solution/:id→ full solution (used by "Give up")
frontend/— client-side React (via Twind/Tailwind).Grid.tsxhandles the pointer/touch drag;Clues.tsxshows the length clues that fill in as you solve;App.tsxorchestrates difficulty, state, and win detection.
| Level | Grid | Words | Lengths |
|---|---|---|---|
| Easy | 6×6 | 3 | 4–6 |
| Medium | 7×7 | 5 | 4–7 |
| Hard | 8×8 | 7 | 5–8 |
Words come from the words table (CREATE TABLE words (word TEXT)). Add more
rows to expand the vocabulary — nothing else needs to change.