- You own all the chips.
- After 600 rounds you own the biggest stack.
A higher resolution is required to access the IDE
- 12
Learning Opportunities
This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.
Statement
This is a port of the Texas hold'em version of Poker.
The source code of this game is available on this GitHub repository.
RULES
The rules of Texas hold 'em can be found all over the web. For example : wikipedia with the hand ranking.
Game parameters
The number of players may vary from
The total of all buy-ins is always
The value of the small blind / big blind are
The first big blind player is random.
These values are given as game inputs.
End game
- when one player owns all the chips.
-
after
600 rounds and if the last hand is not over, it's cancelled.
The players are ranked by elimination round and stack.
Timeout
- He is eliminated.
- He is considered folded for the current hand.
- The chips from his stack are removed from the game.
Heads-up
-
Player 0 is on theleft . - The dealer / button is the small blind.
CARDS
The card's abbreviations are
Hand examples |
| |
| ||
Board examples |
| PREFLOP |
| FLOP | |
| TURN | |
| RIVER | |
Showdown examples |
|
player0's cards, followed by player1's cards ...
player1 was eliminated ( |
Showdown
At the end of each hand, you will know the cards of all the players (even the folded ones).
ACTIONS
Possible actions
There are
-
CALL -
CHECK -
BET amount , where amount is the number of chips that you add to the pot. -
ALL-IN -
FOLD
A list of all possible actions is given in your inputs.
In the inputs,
Bet / Raise
A summary of some betting rules (with examples) can be found here .
Action replacement
In some cases, if you give an "invalid" action, it will be automatically replaced by a "legal" one.
For example :
-
BET 500 with a stack of $400 will be replaced byALL-IN . -
TOTO or other invalid action will be replaced byFOLD .
However if you
The replacement informations are written in the output console and a complete list can be found here .
Other players actions
The actions of all the players are given as well as the round, hand's number, playerId and board cards when each action was done.
The action can be :
-
CALL -
CHECK -
BET_500 , with an underscore after BET. -
ALL-IN -
FOLD -
NONE , if no action during the hand (for example: if all players are directly all-in). Then playerId is-1 . -
TIMEOUT , the player has timeout
The first action given is always your last action.
GRAPHICS
Only the big wins (more than 2 * BB * number of alive players) and level's changes are marked on the scrollbar.
There's a debug mode with "bigger" cards and buttons to show / hide the opponents cards and the folded cards.
The winning probabilities are calculated with a java version of kennethshackleton's SKPokerEval (a Texas Hold'em 7-card hand evaluator).
- You've lost all your chips.
- You do not respond in time.
Game Input
Line 2 : bigBlind the initial values of the blinds.
Line 3 : handNbByLevel number of hands to play to reach the next level.
Line 4 : levelBlindMultiplier blinds are multiply by this coefficient when the level changes.
Line 5 : buyIn initial stack for each player.
Line 6 : firstBigBlindId id of the first big blind player .
Line 7 : playerNb number of players (
Line 8 : playerId your id (
Line 2 : handNb hand's number (starts at
Next playerNb lines :
- stack number of chips in the player's stack.
- chipInPot number of player's chips in the pot. The sum of all the chipInPot values is equal to the pot.
Next line : boardCards board cards (example :
Next line : playerCards your cards (example :
Next line : actionNb number of actions since your last turn.
Next actionNb lines :
- actionRound round of the action.
- actionHandNb hand number of the action.
-
actionPlayerId player id of the action (
-1 if action isNONE ). -
action action (examples :
BET_200 ,FOLD ,NONE ...). -
actionBoardCards board cards when the action is done (example :
AD_QH_2S_4H_X ).
Next line : showDownNb number of hands that ended since your last turn.
Next showDownNb lines :
- showDownHandNb hand's number.
- showDownBoardCards board cards at the showdown.
-
showDownPlayerCards players cards (example :
QH_3S_E_E_5C_H_7D_KC player0's cards, followed by player1's cards ...).
Next line : possibleActionNb number of actions you can do.
Next possibleActionNb lines : possibleAction your possible action (
You can also add a message :
Response time first turn is ≤
Response time per turn is ≤
A higher resolution is required to access the IDE