Inspiration
What it does
How we built it
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for Shadowstack
Inspiration
Shadow art (a pile of junk that throws a perfect silhouette) is one of those things everyone stops to look at. We wanted that "aha" as a daily puzzle: two walls, two silhouettes, one small floor, and a question with a provable best answer that a whole subreddit can argue about in the comments.
What it does
- One puzzle a day. At 00:01 UTC a new board is posted. A light from the front throws each column's tallest stack onto the back wall; a light from the side throws each row's tallest stack onto the left wall. The dashed outlines on both walls are today's targets. Monday is a 4×4 warm-up; Sunday is a 6×6 with stacks up to six high and several pillars.
- Simple controls. Pick a height, tap a square. The isometric light box above the grid updates instantly. Shadows that match turn solid, shadows that are too tall turn red, and the clues around the grid show target vs. current for every row and column. Undo and clear are always there.
- A real optimum. Any build that casts both shadows is valid, but the goal is the fewest cubes. Every column needs one stack of exactly its height and so does every row, and one stack can serve a column and a row only when their heights are equal. So the true minimum is a matching problem, and pillars break the obvious pairings. The game knows the proven minimum and tells you when you've hit it.
- Result card. "Perfect!" when you reach the minimum, otherwise how many cubes over. You also see 1-3 stars, the share of today's builders you beat, the share who found the minimum, your streak, and a countdown. "Copy result" gives a spoiler-free line plus a tiny emoji floor plan for the comments.
- Leaderboard, streaks, flair. Ranked by fewest cubes, then time. 3, 7, 14 and 30-day streaks earn user flair.
How we built it
- Devvit Web: React 19 + SVG client (inline splash in the feed showing today's empty light box with the target silhouettes, expanded game view), Hono server, Redis for the leaderboard (sorted set by cubes, then time), result histograms and streaks.
- Isometric renderer in plain SVG. Lit walls, painter-sorted cubes, per-column and per-row shadow polygons coloured by state. No canvas or 3D library, so it's tiny and crisp on every screen.
- Provable par.
solveMincomputes the minimum with a bipartite matching per height (Kuhn's algorithm). It then builds a concrete solution with exactly that many cubes and checks it, so par is always reachable. Unit tests compare it with brute force on 300 random boards. - Generator. Each date seeds a random "city" of stacks; its two shadows become the puzzle. Pillars prefer cells where an equal-height column and row meet, which makes the obvious pairing impossible. Boards whose minimum is too easy to see are rejected.
- Server-side validation. The server checks the submitted build itself (heights in range, nothing on pillars, both shadows exact) and counts the cubes; scores can't be faked.
- Devvit Journeys: ready, start on the first cube, progress as shadows match, finish with stars; interactions for clears and shares.
Challenges we ran into
- Making the minimum genuinely hard. Without obstacles, the minimum on most boards falls to a simple rule. Pillars placed on exactly the cells where the easy pairing would go turn it into real reasoning.
- Reading 3D on a phone. We tried showing only the isometric view, but tapping cubes in isometric is fiddly. The final design pairs a top-down grid (where you tap) with the light box (where you see), and both share the same state and colours.
Accomplishments that we're proud of
The par is proven, not guessed. When the game says "That is the fewest possible", it's a theorem, checked by brute force in the tests.
What we learned
A daily puzzle needs one clear goal and one honest optimum. The comment thread is where the "how did you get 18?" conversation happens.
What's next
- Weekly "gallery" posts of the most surprising minimal builds.
- A puzzle editor so the community can post its own silhouettes.
- A hard-mode variant with a third (top-down) shadow.
Built With
- devvit
- devvit-web
- hono
- react
- redis
- svg
- typescript
- vite