Skip to content

Data Formats Reference ​

JSON schemas for positions, moves, and search/hint options—used consistently across the CLI (--state, --json, serve), WebAssembly/JS, Python, and C ABI.

Position (StateData) ​

A position keyed by group name. Each group is a list of piles, each pile a list of cards bottom first, written like "AS", "10H" or "~KC" (face down).

json { "piles": { "tableau": [["~5H", "KS"], ["QD"]], "foundation": [[], [], [], []] } }

Groups left out are empty.

FieldTypeDefaultDescription
auxarray | null—The counters of games with counter rules. Left out, they start at the game's initial values.
base_rankinteger | null—
piles (required)Record<string, string[][]>—
redeals_usedinteger—
seedinteger—Seed for shuffles during play (shuffling redeals). Part of the deal.

Move / Action (Step) ​

One step of a solution, as a player would make it. Automatic actions (turning up exposed cards, refilling from a reserve) follow each step and aren't listed.

  • { "type": ... } ("deal") — Deal from the stock.
  • { "type": ... } ("redeal") — Turn the waste back over to form a new stock.
  • { "count", "from", "to", "type": "move" } — Move count cards from the top of from onto to.
FieldTypeDefaultDescription
count (required)integer—
from (required)PileRef—
to (required)PileRef—
type (required)"move"—
  • { "piles", "type": "remove" } — Remove the top cards of these piles.
FieldTypeDefaultDescription
piles (required)PileRef[]—
type (required)"remove"—
  • { "from", "index", "to", "type": "pick" } — Move the single card at position index (0 = bottom) of from onto to.
FieldTypeDefaultDescription
from (required)PileRef—
index (required)integer—
to (required)PileRef—
type (required)"pick"—
  • { "from", "to", "type": "deal_secondary" } — Deal one card from a secondary stock from onto to.
FieldTypeDefaultDescription
from (required)PileRef—
to (required)PileRef—
type (required)"deal_secondary"—
  • { "from", "to", "type": "extract" } — Take the second card from the top of from and put it on to, leaving the top card.
FieldTypeDefaultDescription
from (required)PileRef—
to (required)PileRef—
type (required)"extract"—

PileRef ​

A pile, named by its group and its index within the group (from 0).

FieldTypeDefaultDescription
group (required)string—
index (required)integer—

Search Options (SolveOptions) ​

Search limits and knobs.

FieldTypeDefaultDescription
autoplaybooleantruePlay provably safe foundation moves automatically (when the rules allow it).
max_statesinteger2000000Stop after visiting this many distinct positions.
shortenbooleantrueShorten winning lines by cutting out detours (default true).
strategyStrategy"auto"
timeout_msinteger | null—Stop after this many milliseconds of wall-clock time (native targets only).

Strategy ​

Search strategy.

  • "depth_first" — Depth-first, heuristic ordering. Can prove unsolvability.
  • "best_first" — Best-first by heuristic. Can also prove unsolvability, at a higher memory cost.
  • "auto" — Best-first for a share of the budget, then depth-first with the rest.

Hint Options (HintOptions) ​

Hint settings.

FieldTypeDefaultDescription
max_candidatesinteger3Maximum ranked candidates returned by [hints] (default 3).
samplesinteger16Random guesses at the hidden cards (ignored when nothing is hidden).
seedinteger0
solveSolveOptionsstandard defaultSearch options for each guess. Its max_states is the budget for each guess.

SolveOptions ​

Search limits and knobs.

FieldTypeDefaultDescription
autoplaybooleantruePlay provably safe foundation moves automatically (when the rules allow it).
max_statesinteger2000000Stop after visiting this many distinct positions.
shortenbooleantrueShorten winning lines by cutting out detours (default true).
strategyStrategy"auto"
timeout_msinteger | null—Stop after this many milliseconds of wall-clock time (native targets only).

Strategy ​

Search strategy.

  • "depth_first" — Depth-first, heuristic ordering. Can prove unsolvability.
  • "best_first" — Best-first by heuristic. Can also prove unsolvability, at a higher memory cost.
  • "auto" — Best-first for a share of the budget, then depth-first with the rest.

Dual-licensed under MIT or Apache-2.0.