Live Links & Judge Quick-Start

Inspiration

The best daily games on Reddit feel like a shared ritual: everyone opens the same post over morning coffee, plays in 60 seconds without leaving their feed, and immediately drops into the comment section to compare scores without spoiling the puzzle for anyone scrolling behind them.

Most web puzzles ported into Reddit feel sluggish or bolted on—bloated JavaScript bundles, awkward scrollbars inside mobile inline feeds, trust-the-client leaderboards that break on day one, or "random" generators that occasionally emit unsolvable boards. We built RELAY ZERO from day one as a Reddit-native daily optical engineering ritual: instant 23.4 KB load inside height: "tall", tactile 60fps laser physics, mathematically proven daily optimal Par, server-side anti-cheat verification, and a 1-click spoiler-free emoji scorecard designed specifically for Reddit comment threads.

What it does

Every day at 00:00 UTC, RELAY ZERO publishes a fresh interactive optical bench (RELAY ZERO #NNN) via Devvit's automated cron scheduler (0 0 * * *):

  • 10-Second Learning Curve, Deep Optimal Routing: A live amber laser fires from the Emitter (🟧). Players tap rotatable optical components—double-sided Mirrors (/), half-silvered Cyan Crystal Splitters (◇) that bifurcate light straight + 90°, and one-sided Armored Gold/Steel Mirrors (◢) whose steel backs shield stray rays—to energize all Emerald Receiver Cores (🟢) simultaneously while avoiding Red Fuse (✕) short circuits.
  • Exact Mathematical Optimal Par: Every daily puzzle displays its true minimum move count (PAR), computed exhaustively via Breadth-First Search. Locking all cores in exact Par awards ⚡ PAR PERFECT ★★★.
  • 1-Click Spoiler-Free Comment Scorecard: Using Devvit's user-scoped Reddit API (permissions.reddit.scope: "user" + reddit.submitComment), players post a uniform-width Unicode grid of their board topology, rank, percentile, and streak directly into the post's comment thread—never leaking any mirror or prism orientation.
  • Devvit Redis Leaderboard & Streaks: Composite sorted-set scoring (moves * 1_000_000 + timeMs) ranks fewest moves first and fastest completion time second, alongside live community solve counts, Par rates, and consecutive UTC daily streaks.
  • Weekly Difficulty Cadence + 7-Day Archive: Difficulty escalates cleanly from Mon–Tue CALIBRATION (5×5, 2 cores) through Wed–Thu BIFURCATION (5×5, 3 cores, 2 splitters) and Fri–Sat OVERLOAD (5×5, 2 fuses, 2 armored), culminating in Sunday 6×6 MASTER (4 cores, 2 fuses, 2 splitters, 2 armored). Judges and players can test all four tiers anytime via the built-in 7-Day Circuit Archive without polluting today's leaderboard.

How we built it

  • Shared Deterministic Core (src/shared/puzzle.ts, src/shared/scorecard.ts): Identical TypeScript module runs on both client and server. An FNV-1a UTC day hash seeds a Mulberry32 PRNG to construct candidate benches, validated by a cycle-safe optical ray-tracer and solved exhaustively with an exact BFS state-space search (solveOptimalPar) to prove solvability and compute exact Par.
  • Ultra-Light 60fps Client (src/client/): Zero frameworks and zero external network/CDN requests (100% Devvit CSP-clean). Built with pure TypeScript, a HiDPI HTML5 Canvas renderer (renderer.ts) featuring spring-eased rotations (easeOutBack), pulsing laser beams, and victory particle sparks, plus a pure Web Audio API synthesizer (audio.ts) generating tactile clicks, harmonic core chimes, and victory chords with zero audio files. Total production client bundle: 23.37 KB gzipped (HTML + CSS + JS).
  • Server-Authoritative Devvit Backend (src/server/app.ts, src/server/index.ts): Built on Hono running on @devvit/[email protected] with Devvit Redis and Reddit integrations:
    • GET /api/init & GET /api/puzzle: serves today's puzzle (with solutionRots stripped!), live leaderboard, community stats, streak, and 7-day archive.
    • POST /api/submit: server-side anti-cheat reconstructs today's deterministic board on the server, re-traces the submitted rotation array, rejects unsolved or fuse-overloaded states, rejects impossible move counts < par, and locks each Redditor's first official completion per day.
    • POST /api/share-comment: posts the deduplicated spoiler-free scorecard comment as the signed-in user.
    • /internal/scheduler/daily-post, /internal/triggers/on-app-install, /internal/menu/post-create: idempotent automated daily posting at 00:00 UTC, automatic initial post on subreddit install, and moderator quick-create menu item.

Challenges we ran into

  • Zero-Scroll Dual-Surface Fit: Reddit's inline post height (height: "tall") behaves very differently on a 390×520 mobile portrait screen versus a 700×520 desktop feed card. We engineered a responsive Swiss-arcade shell that adapts dynamically—showing a compact HUD + full-width touch board on mobile and a dual-column optical bench + telemetry/key/top-operators rail on desktop—with zero scrollbars on both surfaces and 1-tap requestExpandedMode.
  • Splitting Client & Server TypeScript Configs on @devvit/[email protected]: @devvit/web uses conditional "browser" package exports (clientImportInServerCodePanic / serverImportInClientCodePanic), requiring clean split tsconfig.client.json (customConditions: ["browser"]) and tsconfig.server.json builds plus verified devvit.json v1 schema compliance.
  • Guaranteeing Zero Unsolvable Days: Naive random optical boards often start already solved, overload a fuse unavoidably, or require trivial 1-click solves. Combining constrained layout generation with an exact BFS solver over the rotatable state space eliminated bad seeds completely.

Accomplishments that we're proud of

  • 365/365 Mathematical Solvability Proof: Our automated Node test suite (npm test) deterministically generates and exhaustively BFS-verifies 365 consecutive daily boards (2026-12-01 through 2027-11-30, including all 52 Sunday 6×6 MASTER boards) in 914 ms (avgPar = 6.49, range [4..10], 0 unsolvable boards, 4/4 test suites passing).
  • 23.37 KB Gzipped Total Client: Instantaneous in-feed loading with zero external fonts, sprites, audio downloads, or third-party CDNs.
  • Zero-Trust Server Validation: Impossible to spoof a leaderboard time or sub-Par move count from DevTools—every submission is ray-traced and verified server-side in Hono before touching Redis.
  • Full Keyboard & Touch Accessibility: Complete Arrow-key cell navigation, Space/Enter tile rotation, Z undo, R reset, and M mute alongside responsive touch targets.

What we learned

  • Shipping directly on @devvit/[email protected] revealed concrete SDK ergonomics gaps—from conditional export diagnostics and JSDoc/TypeScript mismatches (requestExpandedMode, @devvit/redis camelCase vs lowercase examples) to protobuf server bundle bloat (@devvit/protos). We documented all 8 reproducible engineering observations with exact file paths, line numbers, and concrete fixes in DEVVIT_FEEDBACK_NOTES.md.

What's next for RELAY ZERO

  • Community Circuit Designer: Allow verified solvers to craft custom 6×6 optical benches and submit them as subreddit weekend challenges validated automatically by our exact BFS Par prover.
  • Subreddit vs. Subreddit Weekly Optics Cup: Aggregate subreddit average Par rates across communities running RELAY ZERO.
  • Colorblind Pattern Modes & High-Contrast Optics: Distinct geometric beam dash patterns and shape-coded receivers so every player can read multi-beam bifurcations effortlessly.

Built With

Share this project:

Updates

Submission history