24 Daily
Four cards. Ninety seconds. How many ways can you make 24?
THE STORY
Growing up, my brother Nathan and I had a ritual — grab a deck of cards, deal four, and race to make 24. No timer, no rules, just the two of us at the kitchen table seeing who could find the answer first. It's deceptively fast and more satisfying than it has any right to be. I wanted to build a daily version of that: the same four cards for everyone, everywhere, all at once. The engineering challenge turned out to be less about the game and more about making the math fair — figuring out that (5+8+9)+2 and (2+9)+(5+8) are the same solution, and that a lot of solvers get that wrong.
KEY DECISIONS
A Mulberry32 PRNG keyed on the ET date string gives every player the same four cards with zero server coordination. The puzzle resets at 8 AM ET — not midnight — because that's when people actually play.
A naive string comparison flagged (5+8+9)+2 and (2+9)+(5+8) as different solutions. The fix: parse each expression into an AST, flatten every associative chain, sort operands alphabetically, then compare. One solution, correctly.
A recursive brute-force checker tries all permutations, operator combinations, and parenthesizations before showing a puzzle. Every hand is guaranteed to have at least one solution.
Results show where you ranked for both speed and solution count against everyone who played that day. Gives every player something to chase — not just the fastest.
Puzzle dates are recomputed on the server. The client value is ignored. Computing dates client-side is exploitable — and producing the wrong puzzle for a timezone edge case would break the whole shared-experience premise.
RESULT
Shipped to production at 24daily.vercel.app. All puzzles guaranteed solvable. Equivalent solutions correctly deduplicated. Real-time percentile rankings against all players that day. Full session history stored permanently in Supabase. Runs entirely serverless with zero ongoing maintenance.
STACK