· QuickLab
How we promise “every deal is solvable”: card game solvers and difficulty
Random shuffles include unwinnable deals. How Lantern Cells and Pinegold use a solver to pick deals, measure difficulty and order 120 levels.
Shuffle 52 cards and some deals simply cannot be won. Players cannot tell bad luck from bad play, which feels unfair. So every deal in Lantern Cells and Pinegold was solved by a program before release.
1. States and best-first search
The solver treats each board as a state and explores moves as graph edges. In Lantern Cells the score counts cards not yet home, out-of-order spots in columns, cards buried on top of the next card needed, and occupied cells; lower is closer to done, and the lowest is expanded first. Visited states are hashed; in FreeCell, columns are sorted first so equivalent boards are not searched twice.
2. Safe moves happen automatically
A card can go home safely when both opposite-color suits are one rank below it. The game’s auto-collect uses the same rule, so stored solutions replay exactly in the real rules.
3. A Klondike solver that sees every card
To guarantee a deal is winnable, it is enough for a solver that knows the face-down cards to win it. Whether a human finds that path is checked separately through play. Stock draws are grouped into a single move (“draw N times, then play this card”), which keeps the search small and handles Draw 1 and Draw 3 exactly.
4. Measuring difficulty
| Game | Measure | Meaning |
|---|---|---|
| Lantern Cells | Minimum free cells | Fewest cells needed to solve; fewer means more slack. |
| Lantern Cells | Search nodes | States explored; more means a narrower path. |
| Pinegold | Minimum stock passes | Fewest recycles of the stock needed. |
| Both | Par | Moves in a short solution; the three-star target. |
These combine into a score so difficulty never drops within a pack and pack averages keep rising. Pinegold’s Draw 3 deals fill the last two packs; Lantern Cells’ last pack has only three cells.
5. Tests keep the promise
Tests replay all 120 stored solutions under the real rules, check the difficulty order, and confirm 30 consecutive Daily Deals are solvable. The Daily Deal is shuffled from the date and reshuffled if the hint solver cannot finish in time.
The solver does not guarantee the shortest solution and has a node cap, so measured difficulty can differ from how a deal feels. We keep adjusting the order from real play.