Try to decide how good your hand is at a given moment.Doyle Bunson, professional poker player with 50 years experience
Nothing else matters. Nothing!
Before we dive into the implementation details we have to focus on the core concept of the stateless communication — the statelessness itself. Your bot will not be a poker player in the usual sense of the word. Instead he will be a poker guru who knows a way out of any situation.
Each time the game is waiting for your action the whole game condition transmits to your input. You get all necessary information about the game state and its history in each action request. You just have to analyze this information and make the appropriate decision.
Currently we send all requests by the HTTP POST.
As you see the request data consists of four fields:
[2-9TJQKA]and the suit
The correct response is the identifier of the action as one word.
Remember to check your decision is possible in the current game situation (presents in the actions request field).
If your bot makes invalid response — his action will be treated as fold and you will get the error message by email so you can fix it.
Additionally if your bot becomes unavailable or buggy for a long time he will be blocked until you fix and manually enable him.
Unfortunately we couldn't find an existent format that satisfy our needs. So we tried to make our own — the most readable and self-descriptive XML-based format you ever seen ;) Check out the following example. It represents the state of the very common hand in the midst of play.
Warning! Please parse XML by hand only in the last resort!
Google for parse xml your-language to find suitable library. Internally we generate xml with python xml.etree module.
Describes the table structure.
button attribute points to the seat of the Button player.
E. g. this hand Button is lenny.
table consists of
For each player you know the
name of the bot,
in_stack (stack amount before the dealt) and
that determines the turn and Button rotation order (from 0 to 8). Note that empty seats are not presented at all.
As a help to the newbie players we also calculate and show the current
stack amount for each player.
Holds information about antes and blind posts. Type of the post appears in the
amount attribute indicates the post amount.
Holds the betting history round by round. Player's actions appear in the chronological order.
type may be one of the valid action identifiers (fold, check, call, bet, raise, allin).
Each action has the
amount that indicates the
player's bet after the action applied.
Note that the flop round of the example hand is over — all active players are check. Next action opens up the turn round.
The currently known community cards.
Cards appear in the chronological order.
Each card consists of the
suit and the
Tip: count community cards to determine current betting round.
0 — preflop, 3 — flop, 4 — turn, 5 — river.
In fact foregoing format is a subset of the internal format of our engine. Unfortunately we don't have any document describing it right now but you come across this while using our SDK or hacking the sources. Any case you can expect this format will not undergo major changes. We'll try to keep it backward compatible.