Dawn over the shallows, five islands on the chart, and a brig with one roped-off square of deck. You are the quartermaster: what gets loaded — and what stays on the quay — is your call.
Raid all five islands — then a real optimizer loads the same five decks, live, and shows you the haul you left on the quay.
Five islands, five loading puzzles — here's your manifest next to the proven-best holds.
Pick which boxes to take and where to put them, in a fixed space, for the most value — that is cutting & packing, one of the oldest families in Operations Research; your deck was the 3D case they call container loading. The cruel part is never the geometry alone: it's that every box you load buys space away from every box you haven't loaded yet.
And your two deck laws are real industrial constraints, not pirate flavour: full support (no tile over thin air) and load-bearing tops ("this side up, max 1 on top") are exactly how real freight is allowed to stack.
The last island had 18 pieces and a 4×5 deck, three layers high. Counting only sensible loadings, the choice tree runs to billions of branches — and unlike the assignment puzzles of the world, no clever shortcut is known: 3D packing is NP-hard. Checkers cannot save you; cleverness about which branches to never visit can.
That's why "just try things" plateaus: a human (or a greedy rule) finds a good deck in minutes — and then can't tell whether 20 more gold was possible without rebuilding everything.
The optimizer never "tries decks". It writes every legal position of every box as a 0/1 decision and lets branch & bound loose on the whole space at once:
max Σ value·take[box,spot]
s.t. each deck cell carries ≤ 1 box
each box loaded ≤ once
raised tiles rest on a load-bearing top below
bound the relaxation prices what's still possible:
branch can't beat the best? → prune it ∎
The bound is the trick: a relaxed version of the puzzle gives a guaranteed ceiling for every branch, so almost all of the billions are discarded provably unvisited. What survives isn't a good guess — it's the optimum, with a proof.
Your five islands were solved live in this tab — the HiGHS solver compiled to WebAssembly, running in a worker thread next to the waves. In daylight the same model loads containers and trucks, builds pallets (full support and crush limits included), packs parcels into roll cages and plans warehouse slots — wherever "it never quite fits" costs real money on every single run.
A few percent more on every truck is a truck you didn't pay for.
Use case: truck & container loading ▸ Follow me for more games ▸