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 Bankshot

Inspiration

Mini-golf is the most social sport there is: everyone plays the same hole, and everyone has an opinion about how it should have been played. One hole a day, the same for the whole subreddit, felt like a perfect fit for a Reddit post and its comment thread.

What it does

  • One hole a day. Every day at 00:01 UTC a new hole is posted: walls to bank off, sand that slows the ball, water that costs a penalty stroke, and bumpers. Monday is easy, Sunday is hard. Every hole shows its par.
  • Slingshot controls. Drag back from anywhere, a dotted line and a power bar show direction and strength, let go and the ball flies the other way. Works with a finger on mobile and a mouse on desktop. No other buttons during play.
  • Real physics, fair scores. The ball rolls, bounces off walls and bumpers, slows in sand and lips out of the cup if it's moving too fast. Every hole is generated from the date and checked by a solver before it is posted (layouts it cannot finish in two shots are rejected); par is set from that.
  • Result card. Hole in one, eagle, birdie, par or bogey with 1-3 stars, the share of today's golfers you beat, your streak, today's finishers, and a countdown to the next hole. "Copy result" puts a spoiler-free line on the clipboard for the comments: Bankshot #3 ⛳ Birdie · 1 stroke (par 2) · 0:24.
  • Watch the best lines. After you finish, the top five rounds are listed; tap one to see that golfer's whole line drawn on the course as a ghost, bank shots and all. You only see other people's lines once you've holed out yourself.
  • Streaks and flair. Finishing on consecutive days builds a streak; 3, 7, 14 and 30 days earn user flair.

How we built it

  • Devvit Web: React 19 + SVG client (inline splash in the feed with a preview of the day's hole, expanded game view), Hono server, Redis for leaderboards (sorted set by strokes, then time), result histograms and streaks.
  • Deterministic physics shared by client and server. A shot is an integer drag vector, and the simulation uses only + - * / and square root, which are exactly rounded in every JavaScript engine (no trig, no randomness during play). The client animates the ball; the server replays the submitted shots with the same code and only accepts the score its own replay produces, so the leaderboard can't be faked.
  • Hole generator + solver. Each date seeds a layout (blockers on the straight line from tee to cup to force bank shots, dog-leg walls, sand, water with a gap, bumpers, scaled by weekday). A two-level sampled search proves the hole can be holed in at most two strokes before it is posted, and its line is kept as a test witness.
  • Devvit Journeys: app ready, journey start on the first shot, progress toward the cup after each shot, end with stars; interactions for retries, ghost replays and shares.
  • Unit tests generate a month of holes and replay each witness line through the validator.

Challenges we ran into

  • Determinism across devices. Trig functions are not guaranteed to match between engines, so aiming uses integer vectors and normalisation by square root only.
  • Holes that are fun, not impossible. Random walls easily seal the cup off. The solver rejects layouts it can't finish in two shots and tries again; generation takes milliseconds.
  • Spoilers. Ghost lines are a great way to learn a hole, but they would ruin it. They are only sent to players who have already finished.

Accomplishments that we're proud of

Bank shots feel satisfying, and the server-side replay means every score on the board is real.

What's next

  • Community holes: players design a hole in a simple editor and the most upvoted one becomes a daily hole.
  • Weekly "course" of seven holes with a total score.
  • Moving obstacles (windmills, of course).

Built With

Share this project:

Updates

Submission history