What it is
Roundtrip is a daily route puzzle. Every day at 12:00 UTC a new town map appears as a post: a depot, ten to fifteen bus stops, and on most days a river or an express road. You draw one loop that leaves the depot, passes every stop and comes home. The shorter the loop, the better.
It looks simple and it is easy to get a loop. Getting the shortest one is another matter, and the game always knows what the shortest is.
How a day goes
- The post shows today's town as a poster with one button: Draw your loop.
- You tap the stops in the order you would drive them, or drag through them. The line follows your finger and each stop is punched with its number.
- The last stop closes the loop and rings the bell. A ticket shows your length in metres and how far over the shortest possible loop you are, with one to three punches for how close you got.
- You redraw as often as you like. Your best loop stays faintly on the map so you can draw against it, and every loop counts as a try.
- When you are happy you post it. That makes it final, and the map fills with everyone else's roads.
- From there you can replay any leader's loop, lay the perfect loop over your own, comment your result, or keep drawing for fun.
What makes it a Reddit game
- Everyone's roads on one map. After you post, every player's loop is drawn at once, and a road gets thicker the more players drove it. You see where the whole community agreed, and the one odd crossing only three people tried.
- No spoilers, by design. Other loops, the board and the answer stay hidden until you have posted your own, and the comment button writes a line with your score but never your route. The thread can argue about the town without ruining it.
- A board that rewards thinking. Shortest loop wins. Ties go to fewer tries, then to whoever posted first, so "perfect on the first try" is the thing to brag about.
- "3 other players drew exactly your loop." The game tells you how many people ended up on the same roads as you.
- The depot thread. A pinned comment in every post carries yesterday's podium. "Comment my result" replies under it from the player's own account, only when they tap it.
- Streaks, and old routes that stay open. Each post keeps its own town and its own board, so the subreddit becomes an atlas you can walk back through.
- It works alone. With nobody else around, you still play against the shortest possible loop and can see it after you post. An empty subreddit is still a full game.
Daily content
Towns are built from the date, so every community gets the same one, and each has a name such as Nettleford or Kettle Parva.
- Monday and Tuesday are open country with 10 and 11 stops.
- Wednesday adds a river: every leg that crosses it pays a ferry fare of 300 to 600 metres, so the question becomes where to cross, and only twice.
- Thursday adds an express road between two stops that counts half. Roughly one day in four it is a trap that the best loop leaves alone.
- Friday to Sunday have both, with up to 15 stops.
- Towns come in four shapes: a loose scatter, three neighbourhoods, a ring road with a tempting middle, and a grid full of near-equal choices.
- Each weekday is printed on its own ticket colour, so the feed shows at a glance which day a post is from.
Every town is calibrated before it is posted. The server solves it exactly, so the target is the true shortest loop. It also draws the loops a person tries first (nearest stop next, round like a clock hand, round the outside and dip in for the rest, each with and without the express road) and throws the town away if any of them is already the answer. Monday is gentle on purpose. From Wednesday the best of those obvious loops is 2% to 7% too long, so the first idea is rarely the answer. Across the next 140 days every single town meets its day's target.
How I built it
- Devvit Web, with an inline poster view for the feed and a full-screen game.
- One rules file shared by the browser and the server. A leg is a whole number of metres, so both sides agree exactly. The server measures every loop itself and never trusts a length from the browser.
- An exact solver on the server. With at most 15 stops, the shortest loop can be found outright (the Held-Karp method) in well under a second. The answer is saved with the day's map and is not sent to a player until they have posted.
- Redis holds each day's board as a sorted set, ordered by length, then tries, then arrival. Each player's loop is packed into the set member, so the board loads in one read. Shared roads are a hash of counters, one per leg, so the "everyone's roads" view costs the same for ten players or ten thousand.
- Canvas 2D for the map: paper grain, a street-atlas grid, the river, and loops that draw themselves stroke by stroke in replays.
- A scheduler job posts the town each day and pins the depot comment. It is safe to run twice, and a second job checks every hour so a failed attempt is retried the same day.
- Devvit Journeys events mark app ready, journey start on the first stop, progress on every try, and journey end when a loop is posted.
- Sound is synthesised in the browser: a ticket punch per stop and a bus bell when the loop closes, with a mute button.
- 50 automated tests cover the scoring, the solver, the map builder and its difficulty targets, the game rules and the server's routes. A browser script then plays 23 situations end to end (five screen sizes, touch, keyboard only, an old phone, forty players posting at once) and fails on any error.
The look is an old bus ticket: one sheet of coloured paper, dark ink for the printed map, one bright ink for your loop, three punch holes for your score and an inspector's stamp for your place.
I built it with help from Claude Code.
Challenges
- Spoilers. If the board opened after your first loop, everyone would draw one throwaway loop and then copy the leader. Posting had to be a deliberate, final step that unlocks the community view.
- Too easy at first. An outside tester drew the obvious "round the outside" loop and got a perfect score on the first try. Measuring showed that an obvious loop was already perfect on two days in three. The builder now tests every town against those obvious loops and searches, a few hundred towns at a time, for one that beats them by a set margin.
- Making a hard problem feel light. Finding the shortest loop through 15 points is a famous hard problem. Tap and drag, live distance, a faint copy of your best loop and an exact gap to the target turn it into something you can enjoy for two minutes or twenty.
- Showing a crowd without a mess. Hundreds of overlaid loops are unreadable. Counting how many players used each road and drawing that as thickness keeps it clear at any size.
- Touch accuracy. Stops are kept at least 500 metres apart on the map so a thumb can always pick one out, and a drag has to pass closer to a stop than a tap does, so sweeping past one does not grab it.
What I learned
A daily puzzle needs a target that is always honest. Because the server solves every town, the game can say "201 m over the shortest possible" and mean it, and that one number is what brings people back for another try.
What's next
A weekly timetable that adds up your seven gaps, a live view of roads thickening as players post, and towns drawn by the community.
Built With
- canvas
- devvit
- esbuild
- express.js
- node.js
- redis
- typescript