GUESSIFY
Guessify is a number-guessing game for Android. Pick Easy (1–50), Medium (1–100) or Hard (1–1,000), then narrow the secret using four-way directional feedback: too high, high, low, too low. Two tactical hints reveal a tighter range, then parity and digit sum; both cost points. Solo runs are scored on attempts and hints, with a 50-point floor for a win.

A fair game without a game server
Guess-the-number is easy to build badly: a random number, a compare, a win screen. To make it worth replaying, the feedback has to help without giving the answer away, the score has to reward efficient play rather than luck, and a duel has to stay in sync across two phones. The harder constraint was the backend: Firebase Spark rules out Cloud Functions, so every integrity guarantee had to come from security rules, capped writes, idempotent match IDs and a client-side referee model.
One source of truth and a referee
Expo SDK 57 with React Native 0.86, React 19, TypeScript and Expo Router. Firebase Auth handles email/password and anonymous guest sessions; Firestore stores profiles, matches, rooms and leaderboard period documents. AppContext composes auth, settings, solo, duel, board and outbox state, while services wrap auth, Firestore, AsyncStorage and the outbox. Every scoring constant and stage definition lives in src/constants/gameRules.ts, which feeds both the stage picker and the in-app rulebook. In duels, the setter's device keeps the secret in memory and scores each guess; Firestore rules reject the secret while a round is PLAYING, and only the referee can write a result. Weekly and monthly boards are real documents keyed in UTC (2026-W43, 2026-10).
What was actually hard
- ▸Four-way feedback without leaking the answer — a ±12% window around the target, scaled to the range, turns higher/lower into four signals; the same helper drives solo and duel feedback.
- ▸Fair duels on Spark — the setter's phone is the referee, the target stays out of Firestore while PLAYING, and a Firestore transaction checks whose turn it is and whether the round is still live before a guess lands.
- ▸Awards that survive retries — every result uses a client match ID as the document ID and setDoc, so a retry or outbox flush overwrites the same document instead of double-counting points.
- ▸Period boards that agree across time zones — weekly and monthly keys use UTC calendar parts, so every client rolls over at the same instant instead of local midnight.
What broke (and what I learned)
The 1.0 build shipped with confident copy that the code did not support: the About screen claimed server-side score validation, the rulebook gave the setter a 10-attempt cap that never existed, and the rank card showed a hardcoded "Gold II". v1.1.0 replaced all of it with values derived from gameRules.ts and the player's real stats. The lesson was smaller than the bug: if a rule is shown to a player, it should be read from the same constant that enforces it.
3
Solo stages
3
Duel modes
19
Engine tests
28
Security-rules tests
Gallery








