Inspiration
Sudoku meets N-Queens, but make it Reddit. We wanted to build a logic puzzle that feels familiar yet fresh -- one that lives natively in the Reddit feed as a Devvit app. The dog paw theme was a no-brainer: who doesn't want to place pups on a grid instead of numbers? We drew inspiration from classic logic puzzles and wanted to prove that Reddit apps can be polished, full-featured games -- not just forms and simple widgets.
What it does
DogDoku is a logic puzzle where players place dog paws on a grid following three rules: one dog per row, one per column, one per colored region, and no two dogs can touch (even diagonally). It features:
- Progressive difficulty -- grids scale from 5x5 up to 12x12 as you level up
- Daily puzzles -- a new 8x8 challenge every day, identical for all players
- Lives system -- 3 hearts, wrong placements cost a life
- Hint system -- backtracking solver reveals valid placements (first hint free, then 1 coin each)
- Shop -- earn coins per win to unlock 6 dog skins and 4 background themes
- Reddit flair -- automatically awards "DogDoku Lv.X" flair on completion
- Victory sharing -- post your win to the level's leaderboard thread
- Drag-to-draw -- quickly place paw markers across multiple cells
- Procedural audio -- all sounds synthesized via Web Audio API, zero audio files
- Confetti celebration -- custom canvas particle animation on win
How we built it
Using Devvit & Reddit API integration for flair, comments, and post creation. Scheduled cron jobs for daily puzzle generation and cleanup. Puzzle generation and solving (puzzle.ts) runs on both client and server. A backtracking solver validates placements in real-time and checks solution uniqueness during generation. Daily puzzles use a Mulberry32 PRNG seeded from the date for deterministic, reproducible results.
Challenges we ran into
Solution uniqueness verification -- generating puzzles with exactly one solution requires running a full backtracking solver for each candidate, which is computationally expensive. We had to tune retry limits (200 for small grids, 80 for large) and fall back gracefully to near-unique puzzles when needed.
Real-time placement validation -- every time a player places a dog, we run
solvePuzzleWithto confirm the board is still solvable. This prevents soft-locks but requires the solver to be fast enough for instant feedback. We optimized by pruning early on constraint violations.Input model complexity -- supporting single-tap (paw marker), double-tap (dog), drag-to-draw, keyboard navigation, and touch hit-testing all in one grid component was tricky. The drag system uses
document.elementFromPointfor accurate touch tracking during rapid movement.Landscape layout overhaul -- making the game work well in landscape orientation required a complete layout restructure: hiding the header, floating a side info button, and splitting into a 70/30 grid/panel view with glassmorphism effects.
Daily puzzle consistency -- ensuring every player sees the same puzzle each day required careful seeding and deterministic randomness. The system gracefully regenerates from the seed if Redis data is cleaned up by the 4 AM UTC cleanup job.
Accomplishments that we're proud of
Zero audio file assets -- every sound (pops, clicks, victory jingle, completion chime) is synthesized in real-time using Web Audio API oscillators. This keeps the bundle tiny and eliminates asset loading issues.
Custom confetti system -- a hand-rolled Canvas 2D particle animation with gravity, tilt, and color variation instead of pulling in a library.
The solver-as-validator UX -- running a full backtracking solver on every placement to prevent soft-locks is an unusual approach, but it makes the puzzle genuinely fair. Players can never paint themselves into a corner.
Seamless Reddit integration -- user flair awards, leaderboard comment threads, scheduled daily puzzle creation, and moderator menu actions all feel native to the Reddit experience.
Shop with optimistic updates -- purchases and equipment changes apply instantly on the client, then confirm or roll back from the server. No loading spinners for cosmetic changes.
Scaling difficulty -- grids grow from 5x5 to 12x12, with difficulty labels (Easy through Expert) and the solver ensuring every puzzle is always solvable.
What we learned
Shared code is a superpower -- running the same puzzle generation and solving logic on client and server eliminated an entire class of bugs and let us validate placements instantly without extra API calls.
Deterministic randomness solves caching -- seeding PRNGs from dates means daily puzzles are reproducible without needing to store them permanently, while still being unique across days.
Progressive enhancement works -- keyboard navigation, touch drag, and mouse input all coexist in the grid component with graceful fallbacks.
What's next for DogDoku
- Multiplayer races -- real-time head-to-head puzzle solving on the same daily puzzle
- Streak system -- consecutive daily completions tracked with bonus rewards
- Puzzle editor -- let players create and share custom puzzles
- Leaderboard overhaul -- global rankings by speed and accuracy, not just flair levels
- More shop items -- animated dog skins, seasonal backgrounds, custom grid colors
- Accessibility pass -- screen reader support, colorblind-friendly region palettes, high-contrast mode
- Puzzle packs -- themed collections of curated puzzles with progression rewards
- Performance tuning -- further optimize the solver for instant feedback on 12x12 grids
Built With
- devvit
- react