Inspiration
Wordle proved a daily puzzle can be a habit. I wanted one where the whole subreddit is guessing the same thing, so the payoff is seeing how everyone else did. Earthquakes fit: seismologists really do find an epicenter from the delay between P waves and S waves at several stations, and the idea clicks in about three seconds. Far stations shake later.
What it does
Every UTC day there is one fictional earthquake. Three or four seismograph stations show their S-P delay. The delay gives each station a circle of possible locations, but noise means the circles never quite meet. You drag a pin to where you think the epicenter is and lock in.
Then you get one result card: the true epicenter, how many km off you were, your score and stars, the crowd's cloud of pins, the crowd median, your percentile and your streak. A spoiler-free share line lets you compare without giving anything away.
Difficulty follows the week. Monday has four stations and low noise. Saturday has three stations, heavy noise, and no fault line hint.
How to play
"Far stations shake later. Find where it started." That is the whole tutorial, plus a three-second wave animation.
How I built it
- Devvit Web inline post with a splash screen, opening into an expanded game view.
- Procedural generator with a fairness gate. Each puzzle is checked before it ships: a best-fit solver must land close to the truth, it must converge to a single answer, and the station layout must be well spread. Unfair puzzles are re-rolled.
- Hard to cheat by design. The answer, the random seed and the crowd data stay on the server until your guess is stored. The client sends only
{x, y}; the server computes the score. One guess per user per day, enforced with an atomic set-if-absent write in Devvit Redis. - Crowd stats from binned counts in Redis, so the median and percentile stay cheap and anonymous. Only the Reddit user id is stored.
- Pure TypeScript core (no I/O, no clock, no randomness) so the game logic is tested with property-based tests, then a thin server layer and a Canvas 2D client.
- Test-first and security-first. I wrote tests before code and kept a checklist of 19 threats (replay, score tampering, hostile input, XSS and more), each with a test. [Fill in final test count and coverage.]
Challenges
- Making the puzzle fair. Pure noise can produce an unsolvable puzzle, so the generator needs a solver to prove each one is solvable, and the difficulty curve needed calibration across weekdays.
- Precision on a phone. Placing a pin on a 1000 km map with a finger is hard, so there is a loupe and keyboard nudging.
- Not turning the game into a calculator. Showing how well your pin fits would let everyone hill-climb to the same answer and flatten the crowd cloud, so the game shows the circles and distances but no fit meter.
- Keeping the whole game cheat-resistant when the client is untrusted.
What I learned
I learned about Devvit Redis, Journeys, and working test-first with a coding agent.
What's next
A probe budget, a past-puzzle archive, a two-station Sunday puzzle, and user flair for streak holders.
Built With
- express.js
- node.js
- typescript
- vite
- vitest

