variant nennt die fehlenden Kernnamen (PLO4, PLO6, SHORT_DECK samt 6+-Alias). Vermerkt: Short Deck bedeutet die umgedrehte Rangfolge (Flush schlaegt Full House), der Kern kann das schon; AOF ist eine binaere Ueberlagerung ueber der Basisart (nur FOLD/RAISE, legalActions massgeblich).
2.7 KiB
2.7 KiB
Contract: Offline Poker Decision Core
Purpose: a pure decision engine. One JSON in, one JSON out - it knows no table, no clock, no window. Nothing else needs to be known.
Interface
- stdin: one JSON object per line — one decision request.
- stdout: one JSON object per line — the decision.
- No prompts, no logging on stdout, no external dependencies (standard library only).
- Language: your choice — Python or Rust preferred. The JSON contract is what counts.
Request (exact field names)
{
"variant": "NLHE",
"bigBlind": 0.1,
"seats": 6,
"heroSeat": 5,
"heroCards": [{"rank": "A", "suit": "HEARTS"}, {"rank": "5", "suit": "HEARTS"}],
"board": {"FLOP": [{"rank": "A", "suit": "CLUBS"}], "TURN": null, "RIVER": null},
"street": "FLOP",
"pot": 1.25,
"toCall": 0.2,
"heroStack": 2.4,
"minRaiseTo": 0.5,
"maxRaiseTo": 20.0,
"legalActions": ["FOLD", "CALL", "RAISE"],
"allowedSizes": [0.5, 1.15, 4.6],
"villains": [{"seat": 2, "stack": 10.4, "folded": false}]
}
rankvalues:TWO … TEN, JACK, QUEEN, KING, ACE;suitvalues:CLUBS, DIAMONDS, HEARTS, SPADES.boardstreets arenullor a list of cards.legalActionsis authoritative — nothing outside it may be returned.allowedSizesis optional (given by the client in some formats); when present, a raise size must be one of these values.variantvalues:NLHE,PLO4,PLO5,PLO6,SHORT_DECK(alias6+),K_POKER,AOF.SHORT_DECK(Texas Six Plus): a 36-card deck, sixes and ace low — so the ranking is upside down, a flush beats a full house; the core already ranks it that way.AOF(All-in or Fold) is a binary overlay, not a base game: keep the base variant (NLHEorPLO4) and restrictlegalActionstoFOLDandRAISE(the raise is the whole stack). The field is authoritative, so this needs no separate variant.
Response
{"action": "CALL", "size": null, "confidence": 0.72, "reason": "top pair, good price"}
action:FOLD,CHECK,CALL,RAISEorABSTAIN.size: the total amount for a raise, otherwisenull.confidence:0..1.ABSTAINmeans: the engine is not sure — the caller decides what to do.
Requirements
- Pure functions only; stdlib only.
- Never return an action outside
legalActions. - Preflop: chart-based, by position and action sequence.
- Postflop: equity (Monte-Carlo is fine), pot odds, expected value per legal action.
K_POKER: ifallowedSizesis present, pick from it and never invent a size.AOF: binary decision only.- Include a test suite that runs offline, plus one CLI entry point.
- Only maths. It knows no table, no window, no clock - nothing else needs to be known.