Skip to content

Commit

Permalink
fix the min raise issue (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
SirRender00 authored Apr 9, 2022
1 parent 7cfade0 commit 465237f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# texasholdem
A python package for Texas Hold 'Em Poker.

Latest Stable Release Version: v0.6.2 \
[Changelog](https://github.com/SirRender00/texasholdem/releases/tag/v0.6.2) \
Latest Stable Release Version: v0.6.3 \
[Changelog](https://github.com/SirRender00/texasholdem/releases/tag/v0.6.3) \
[Documentation](https://texasholdem.readthedocs.io/en/stable/)

Latest Experimental Release Version v0.6.2 \
[Changelog](https://github.com/SirRender00/texasholdem/releases/tag/v0.6.2) \
Latest Experimental Release Version v0.6.3 \
[Changelog](https://github.com/SirRender00/texasholdem/releases/tag/v0.6.3) \
[Documentation](https://texasholdem.readthedocs.io/en/latest/)

Roadmap \
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
author = 'Evyn Machi'

# The full version, including alpha/beta/rc tags
release = 'v0.6.2'
release = 'v0.6.3'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "texasholdem"
version = "0.6.2"
version = "0.6.3"
description = "A texasholdem python package"
authors = ["Evyn Machi <[email protected]>"]
keywords = ['texasholdem', 'holdem', 'poker']
Expand Down
9 changes: 5 additions & 4 deletions texasholdem/game/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,13 +469,14 @@ def _player_post(self, player_id: int, amount: int):
amount = amount - self._get_pot(i).chips_to_call(player_id)
self.pots[i].player_post(player_id, self.pots[i].chips_to_call(player_id))

last_to_call = self._get_pot(last_pot).chips_to_call(player_id)
prev_raise_level = self.pots[last_pot].raised
self._get_pot(last_pot).player_post(player_id, amount)
amount = amount - last_to_call

last_raise = self.pots[last_pot].raised - prev_raise_level
self.last_raise = max(last_raise, self.last_raise)

# players previously in pot need to call in event of a raise
if amount > 0:
self.last_raise = max(amount - self.last_raise, self.last_raise)
if last_raise > 0:
for pot_player_id in self._get_pot(last_pot).players_in_pot():
if self._get_pot(last_pot).chips_to_call(pot_player_id) > 0 and \
self.players[pot_player_id].state == PlayerState.IN:
Expand Down

0 comments on commit 465237f

Please sign in to comment.