Skip to content

Commit 955ed2b

Browse files
committed
Fix bug of no-limit
1 parent 7a05e68 commit 955ed2b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

rlcard/envs/nolimitholdem.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
DEFAULT_GAME_CONFIG = {
1212
'game_num_players': 2,
13-
'chips_for_each': [100] * 2,
13+
'chips_for_each': 100,
1414
'dealer_id': None,
1515
}
1616

@@ -22,8 +22,6 @@ def __init__(self, config):
2222
''' Initialize the Limitholdem environment
2323
'''
2424
self.name = 'no-limit-holdem'
25-
# 'chips_for_each' must have num_players length
26-
DEFAULT_GAME_CONFIG['chips_for_each'] = [100] * config['game_num_players']
2725
self.default_game_config = DEFAULT_GAME_CONFIG
2826
self.game = Game()
2927
super().__init__(config)

rlcard/games/nolimitholdem/game.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def configure(self, game_config):
4545
If dealer_id is None, he will be randomly chosen
4646
'''
4747
self.num_players = game_config['game_num_players']
48-
self.init_chips = game_config['chips_for_each']
48+
# must have num_players length
49+
self.init_chips = [game_config['chips_for_each']] * game_config["game_num_players"]
4950
self.dealer_id = game_config['dealer_id']
5051

5152
def init_game(self):

0 commit comments

Comments
 (0)