How it works

Solving Jumbleberry Fields, step by step

"Solved" means I know the best possible move in every situation the game can produce, and exactly how much each move is worth. Here is how a computer works that out, why this game solves in under a second while Yahtzee needs hundreds of millions of positions, and how I checked the answer.

1 · Count the game

Fewer situations than it looks

Five jars, each showing one of five things, can land 3,125 ways. But only how many of each berry you have matters, not which jar holds which. That leaves just 126 different hands. Every move you make is a lock, meaning a set of berries to keep, and there are only 252 different locks. Nine boxes that are each open or used give 512 scorecards.

126different hands of 5 berries
252different locks you can make
512scorecards (each box open or used)
193,536decision points: 512 scorecards × 3 rolls × 126 hands

The points already on your card don't change your best move, because Jumbleberry Fields has no bonuses. Only which boxes are still open matters for the future. That is the big shortcut. Yahtzee needs to remember your top-section total for its 35-point bonus and whether you can still earn Yahtzee bonuses, which is why Ballpark Figures' Yahtzee solve had to work through about 405 million positions.

2 · Work backwards

Start at the last roll of the game

Planning forward is hopeless: every choice branches into hundreds of futures. So the solver starts at the end, where the answer is obvious, and steps backwards one decision at a time. A round looks like this, and the solver fills in every box from right to left:

start of roundValue of the scorecardAverage of all 126 first rolls
roll 1See a hand126 possible hands
choicePick a lockAverage over every way the re-rolled jars land
roll 2 → choicePick a lock againSame idea, one roll left
roll 3 → choicePick a boxPoints now + value of the scorecard that's left

The last round. Suppose only Free Roll is left. After your third roll there's nothing to decide. After your second roll, the solver tries every lock. For each one it lists every way the other jars can land, multiplies each result by its chance, and adds them up. The lock with the highest average wins: keep Pickleberries and Moonberries, re-roll the rest. One roll earlier it does the same, using those averages as the payoff. Averaged over first rolls, a lone Free Roll is worth 19.4 points.

Every earlier round works the same way, with one addition. When you pick a box, the payoff is the points you score now plus the value of the scorecard that's left, which the solver has already worked out because it is going backwards. After 511 scorecards it reaches the empty card: 121.80 points on average with perfect play.

value(card) = average over first rolls of best lock → average over re-rolls of best lock → average over re-rolls of best box: points now + value(card with that box used)

In code this is about 30 lines (solver.py, and jbf-engine.js for the browser). It runs in under a tenth of a second.

3 · Watch it think

Ask the solver about any situation

Pick which boxes are still open, which roll you're on, and tap the jars to change berries. The solver ranks every possible move by the average final score it leads to, counting from this round on.

Open boxes (tap to mark used)
Roll
Jars (tap to change)

4 · Playing for prizes

When the score you need matters

Maximizing the average ignores the prize lines. To play for them, the solver needs one more fact: how many points you've banked. Anything above 141 counts the same, so the banked score only needs 142 values (0 to 141). That turns 512 scorecards into about 73,000. The payoff at the end is no longer points but Moonberries: 1 for 121 to 140 and 2 for 141 or more. Running the same backwards process gives the best achievable chance of each prize from any position, and the strategy that wins the most Moonberries over time: 0.67 a game. It takes about a second.

This is the part a Yahtzee solve usually leaves out. Beating a target is a different goal from scoring the most on average, and here I could solve it exactly.

5 · What the numbers say

What each box is worth to keep

Because every scorecard has a value, I can ask what it costs to throw away your first round as a zero in each box. This is the solver's own ranking of which box to sacrifice:

Zero in round 1Points it costs on average

Basket of 5 is by far the cheapest box to give up. Free Roll and Basket of 3 are the most expensive. The par sheet below is built from the same idea.

6 · A shortcut you can remember

Nine numbers that get you within 2 points of perfect

Nobody can run the solver in their head, so I boiled it down to one number per box. A par is what an open box is worth to you. When a round ends, score your hand in the box where points minus par is biggest. A bad round goes where it hurts least compared with par.

  1. Each roll, choose one open box to chase: the one where you can most likely beat its par from the berries you have.
  2. Lock the berries that help that box, and re-roll the rest.
  3. After the last roll, score the hand where points minus par is highest. Five Sugarberries are 10 points. That is 0 against par in the Sugarberry box but +4 in Basket of 5, so Basket of 5 wins.

Four examples

The first is a clear call. The others are where instinct and the par sheet disagree. Every example matches what the exact solver does in that spot.

Played this way the par sheet averages 119.8, 98% of perfect play, and reaches 121 in 48% of games. Both habits that matter most are built in: Jumbleberry and Sugarberry are valued at their maximum, so they are never used as dumps, and Basket of 5 is cheap.

7 · Box by box

How to chase each box, and which ones fade

Sometimes a round has one job: fill a particular box. Here's how perfect play chases each box on its own for a full round, starting from a fresh roll, and what it gets.

BoxHow to chase itAverageScores anything

A box left open doesn't keep its value. The charts show what each box ends up scoring, on average, if it's still open at the start of each round. Jumbleberry, Sugarberry and Free Roll hold their value to the end, so they're safe to leave for later. The baskets, Mixed Basket and Moonberry need luck, and the fewer rounds left to find it, the less they're worth. Basket of 5 starts lowest and ends near 2, which is why it's the box to sacrifice.

Each chart runs from round 1 to round 9 on the same 0–22 point scale.

8 · Checking the answer

How I know it's right