Inspiration

Daily games keep people because everyone gets the same puzzle and can compare. In 2024 a single Wordle answer broke 5.6 million streaks in one day (TODAY), which tells you how much people care about a streak once they have one. Reddit already has the comments, the flair and the feed to make that comparison social. I wanted a daily puzzle where what you compare is something you shaped yourself.

Pruning fit. Cut one branch and the tree puts that energy somewhere else. Every move has a visible consequence, and two players with the same sapling end up with trees that look nothing alike.

What it does

Each day has one sapling and one target crown shape: Windswept, Twin, Broom, Lantern, Slant or Tiers. You get four seasons and six snips, at most two per season.

  • The first time you open it, an 8-second demo snips one twig for you and marks the buds that gained growth with +1. Then it's your turn.
  • Tap a branch to cut it. Each bud shows how many new branches it will grow next season, and when you cut, the numbers on the remaining buds go up. On a phone you can press, see which branch is selected, slide to a different one and lift to cut.
  • Press Grow and watch the season come in.
  • After winter you get a crown-match score (shape filled, minus leaves outside it), the day's par, your rank and a histogram of everyone's scores.
  • A button posts your result as a comment under your name. The server writes the text from your saved round, so the score can't be edited and your snips aren't given away.
  • Then there's today's grove: every player's tree, regrown from their snips, side by side. You can water the trees you like, and the next day's post names yesterday's most-watered tree.
  • Your streak goes into your user flair in that subreddit ("Pruner · 4-day streak"). Playing an old post doesn't touch the streak.

The week has a curve. Monday is gentle and the weekend is hard. Over 28 generated days a player who snips at random averages 39 on Mondays and 18 on Saturdays, while par stays around 78.

How I built it

Devvit Web with React on the client and Hono on the server, Redis for storage, and a Devvit scheduler task set to 0 0 * * * for the daily post.

The core is one deterministic growth simulation (src/shared/sim.ts) that runs in both the browser and the server. A day's puzzle comes from the date. The generator drafts up to 12 trees, runs a beam-search solver on each one to find par, measures how far a random player falls short of par, and keeps the draft that matches the weekday's difficulty. That happens once per day and is cached.

The client only ever sends the list of snips, such as [[12,13],[5,9],[16,25],[]]. The server replays the whole tree and computes the score itself. Because a play is just those few numbers, the grove can redraw everyone's tree without storing any images.

Three things can create the day's post: the scheduler, the install trigger and a moderator menu item ("Post today's Prune"). A Redis key per day makes sure only the first one posts. A player's round is saved with hSetNX, so two taps on Grow at the same moment still store one round.

What I've tested: the game rules, scoring, streaks, the one-post-per-day guard and the double-submit case have unit tests (10), and the whole game runs in a local preview against an in-browser store. The scheduled post, commenting as the player and the flair use Devvit APIs that only run on Reddit, so the local tests don't cover those three.

Challenges

  • Making the same tree come out on every device. Math.cos and Math.sin can differ in the last bit between JavaScript engines, so directions come from a lookup table rounded to six decimals.
  • Tuning the scoring so a good plan lands in the 70s and 80s. The first version punished spill so hard that par sat around 50 and nobody would feel good about it.
  • Teaching the rule fast. The bud numbers carry most of it, and the first-play demo shows one cut and its effect in about 8 seconds.
  • Thin twigs on a phone. A tap now goes to the nearest branch within 24px, and the play screen zooms to the pot and today's shape, so the tree is drawn about a third larger on a 390px-wide phone than in my first build.

What I'm proud of

Par is always reachable, because it's a real plan the solver found. Good players can beat it.

The grove. In the local preview, with 14 sample players and my own round, that's fifteen different trees grown from the same sapling.

What's next

  • Let moderators queue a hand-picked sapling for a special day.
  • A weekly post that shows the most-watered tree from each day.
  • A colorblind-safe option for the fill and spill meters (they already show numbers, but the bars rely on color).

Links

Built With

Share this project:

Updates

Submission history