rlcard.games.nolimitholdem

rlcard.games.nolimitholdem.dealer

class rlcard.games.nolimitholdem.dealer.NolimitholdemDealer

Bases: rlcard.games.limitholdem.dealer.LimitholdemDealer

rlcard.games.nolimitholdem.game

class rlcard.games.nolimitholdem.game.NolimitholdemGame(allow_step_back=False)

Bases: rlcard.games.limitholdem.game.LimitholdemGame

get_action_num()

Return the number of applicable actions

Returns

The number of actions. There are 4 kinds actions (call, raise, check and fold). For ‘raise’ action, we provide all possible raise amount.

Return type

(int)

Return the legal actions for current player

Returns

A list of legal actions

Return type

(list)

get_state(player)

Return player’s state

Parameters

player_id (int) – player id

Returns

The state of the player

Return type

(dict)

init_game()

Initialilze the game of Limit Texas Hold’em

This version supports two-player limit texas hold’em

Returns

Tuple containing:

(dict): The first state of the game (int): Current player’s id

Return type

(tuple)

step(action)

Get the next state

Parameters

action (str) – a specific action. (call, raise, fold, or check)

Returns

Tuple containing:

(dict): next player’s state (int): next plater’s id

Return type

(tuple)

step_back()

Return to the previous state of the game

Returns

True if the game steps back successfully

Return type

(bool)

rlcard.games.nolimitholdem.judger

class rlcard.games.nolimitholdem.judger.NolimitholdemJudger

Bases: rlcard.games.limitholdem.judger.LimitholdemJudger

The Judger class for Texas Hold’em

rlcard.games.nolimitholdem.player

class rlcard.games.nolimitholdem.player.NolimitholdemPlayer(player_id, init_chips)

Bases: rlcard.games.limitholdem.player.LimitholdemPlayer

rlcard.games.nolimitholdem.round

Implement Limit Texas Hold’em Round class

class rlcard.games.nolimitholdem.round.NolimitholdemRound(num_players, init_raise_amount)

Bases: rlcard.games.limitholdem.round.LimitholdemRound

Round can call other Classes’ functions to keep the game running

Obtain the legal actions for the curent player

Parameters

players (list) – The players in the game

Returns

A list of legal actions

Return type

(list)

proceed_round(players, action)

Call other Classes’s functions to keep one round running

Parameters
  • players (list) – The list of players that play the game

  • action (str/int) – An legal action taken by the player

Returns

The game_pointer that indicates the next player

Return type

(int)

start_new_round(game_pointer, raised=None)

Start a new bidding round

Parameters

raised (list) – Initialize the chips for each player

Note: For the first round of the game, we need to setup the big/small blind