Play Live on Reddit Today: https://www.reddit.com/r/ShiftLockGame/comments/1yda1a3/shift_lock_339_20261205_prism_diagonal_par_6/ Public Subreddit: https://www.reddit.com/r/ShiftLockGame/ Devvit App Listing: https://developers.reddit.com/apps/shift-lock-daily GitHub (MIT): https://github.com/ngominhtam1998/shift-lock Standalone Interactive Preview: https://ngominhtam1998.github.io/shift-lock/

Inspiration

The best daily Reddit games take 3 seconds to understand, reward spatial "aha!" flashes in under 45 seconds, and give players an unmistakable daily benchmark worth comparing in the comments. Inspired by Rubik-style torus grids and tactile Neo-Tokyo glazed ceramic tile craft, we created SHIFT LOCK: every UTC midnight, every Reddit player gets the exact same scrambled 4x4 ceramic grid and geometric Target Emblem — and a mathematically proven exact shortest-path BFS Par (4-6 moves).

What it does

  • Tactile 4x4 2D Torus Slide Mechanics: Shift any row left/right or any column up/down by 1 cell — tiles wrap seamlessly across opposite edges of the torus. Play intuitively via 16 flanking anodized arrows, direct pointer/touch tile drag-and-swipe, or blazing-fast keyboard controls (1-4 line focus + arrow keys, Z undo, R reset, H exact 1-step BFS hint).
  • Colorblind-Safe Glazed Ceramic Glyphs: Every tile pairs a distinct high-contrast glaze with a crisp inline geometric SVG glyph — Warm Coral Circle, Electric Cyan Diamond, Sun Amber Triangle, and Emerald Square-Frame — plus glowing corner lock pips and emerald rail highlights as rows and columns lock into place.
  • Exact Optimal BFS Par (4-6 Moves) & Weekly Arc:
    • Mon-Tue: CALIBRATION (Par 4)
    • Wed-Thu: INTERLOCK (Par 5)
    • Fri-Sun: GRAND TORUS (Par 6)
    • Cycles through 24 curated balanced geometric emblems (Prism Diagonal, Torii Gate, Quadrant Seal, Shuriken Core, Origami Fold, Vortex Spiral, Cyber Loom, etc.) with dihedral & color permutations so every UTC day feels fresh.
  • Zero-Asset Procedural WebAudio Foley: Real-time Web Audio API synthesis delivers crisp ceramic detent clicks (pitch-differentiated by row vs column), harmonic fifth line-lock chimes, undo snaps, hint pings, and crystalline Par victory arpeggios with a persistent mute toggle.
  • Reddit-Native Devvit Web + Redis Community Competition:
    • Server-Authoritative Move Replay Verification (POST /api/solve): Every daily submission is replayed deterministically on the Express server against today's UTC board so Par scores cannot be forged.
    • Live Global Move-Distribution Histogram & Fastest Par Leaderboard: Tracks daily completions, ★ PAR / PAR+1 / PAR+2 / PAR+3+ global percentages, fastest Par solvers via Redis sorted sets (zAdd/zRange/zRank), and persistent multi-day user streaks.
    • 1-Click Spoiler-Free Reddit Comment Share (runAs: 'USER'): Posts a clean emoji scorecard directly to today's Reddit thread (with a strict server-side once-per-day anti-spam guard) while leaking zero move coordinates or arrows.
    • Daily Archive & Endless Practice Lab: Browse and play the last 12 UTC daily editions with live ceramic emblem previews & saved ★ PAR medals, or launch infinite on-demand PAR 4 / PAR 5 / PAR 6 practice boards.
    • Zero-Touch Subreddit Automation: Includes onAppInstall, UTC midnight cron (0 0 * * *), and Moderator Menu "Create Shift Lock Daily Post" triggers, plus seamless standalone localStorage fallback for static web previews.

How we built it

  • Bitwise uint32 Torus Engine + Exact Bidirectional BFS (src/shared/engine.ts): Packs all 16 4-color cells into a single unsigned 32-bit integer (2 bits per cell) and executes row/column cyclic torus shifts in pure bitwise ops (invertMoveId(m) = m ^ 4). Level-synchronous Bidirectional BFS proves exact shortest-path optimality (4..6 moves) in < 0.5 ms per puzzle — zero precomputed tables required.
  • Ultra-Light Vanilla TypeScript + Vite Client (25.4 kB gzipped initial payload): Built with zero runtime frameworks and zero external image/font/audio requests (index.html 0.58 kB + main.css 5.40 kB + main.js 19.40 kB gzipped) for instant loads inside Reddit mobile and desktop webviews.
  • Devvit Web Server (@devvit/[email protected] + Express + Redis): Bundled cleanly to dist/server/index.cjs with strict split TypeScript configs (tsconfig.client.json & tsconfig.server.json) and a full in-memory Redis store adapter for deterministic automated testing.

Challenges we ran into

  • Guaranteeing Exact Mathematical Par Across Multiple Years: Random scrambles on a 2D torus frequently admit hidden shorter shortcuts due to row/column commutation and color symmetries. Solving this with a pure-bitwise level-synchronous Bidirectional BFS allowed us to reject any scramble with a < par shortcut on-the-fly in under 1 millisecond — enabling full mathematical verification across all 731 daily boards (2026 + leap year 2028) in under 300 ms!
  • One-Screen Ergonomics on 390px Reddit Mobile Webviews: Fitting a live 4x4 target reference emblem, move/par/timer HUD, 4x4 interactive ceramic grid, all 16 flanking shift arrows, and an Undo/Reset/Hint action deck inside 390x844 mobile without scrolling or horizontal overflow required responsive CSS clamp() geometry and a compact mobile target briefing strip.

Accomplishments that we're proud of

  • 16/16 Automated Tests Passing (100%): Including full mathematical Bidirectional BFS verification across all 365 days of 2026 + 366 days of leap year 2028 (731 daily boards) proving exact 4 <= par <= 6 solvability and zero shorter shortcuts, move invertibility & period-4 wrap invariants, undo/reset/hint accuracy, server anti-cheat replay, Redis streak/leaderboard/histogram logic, and spoiler-free share card formatting.
  • Verified Zero-Error Real Headless Chrome QA: Tested end-to-end across Desktop (1280x720) and Mobile (390x844) confirming 0 console errors, 0 uncaught page errors, 0 failed network requests, and 0px horizontal overflow.
  • 25.4 kB Gzipped Total Client Load: Instant, responsive, offline-capable standalone preview alongside full Devvit Web + Redis integration.

What's next for SHIFT LOCK

  • Daily Head-to-Head Ghost Races: Share a challenge link to race a friend move-for-move on the exact same Practice seed.
  • Subreddit Seasonal Emblem Packs: Allow moderators to curate custom seasonal 4x4 ceramic emblem themes and weekly Par tournaments.
  • 5x5 Weekend Hyper-Torus Bonus Mode: Optional extended bonus board unlocked after hitting ★ PAR on Sunday's Grand Torus.

Built With

Share this project:

Updates

Submission history