dealbreaker 1.4.0

A data-driven solver for patience / solitaire card games: describe a game's rules as data, get solutions or proofs of unsolvability.
Documentation

Dealbreaker models solitaire variants as small JSON files and solves them with a single engine — finding winning lines, proving unsolvability, suggesting fair hints, and maximising scores in points games. It aims to cover all French-pack card-pile patience games with meaningful player decisions.

  • 50 built-in games — Klondike, FreeCell, Spider, Yukon, TriPeaks, Poker Squares, and more, plus custom games in JSON.
  • Runs everywhere — CLI, Rust crate, JavaScript/TypeScript (WebAssembly), Python, and C ABI.
  • Fast — solves 31,996 of 32,000 Microsoft FreeCell deals in 7.4 ms mean time, proving #11982 unsolvable (benchmarks).

Quick start

CLI (or download a pre-built binary from Releases):

cargo binstall dealbreaker-cli   # or: cargo install dealbreaker-cli
dealbreaker solve freecell --ms 1

Docker:

docker run --rm ghcr.io/samdobson/dealbreaker solve freecell --ms 1

Python (pip install dealbreaker):

from dealbreaker import Solver

solver = Solver.from_preset("freecell")
result = solver.solve(solver.deal_microsoft(1))
print(result["outcome"], len(result["steps"]), "steps")

JavaScript / TypeScript (npm install dealbreaker):

import { Solver } from "dealbreaker";

const solver = Solver.fromPreset("freecell");
const result = solver.solve(solver.dealMicrosoft(1));
console.log(result.outcome, result.steps.length, "steps");
solver.free();

See the documentation for Rust, C/Swift/Kotlin, Web Workers, and custom JSON games, or try it directly in your browser with the live web demo.

License

Dual-licensed under MIT or Apache-2.0, at your option.