Skip to content

Commit

Permalink
Backport of 0.7.3 to 0.8 (#166)
Browse files Browse the repository at this point in the history
* fix: random agent can go all-in if possible
* Bump to 0.8.1
  • Loading branch information
SirRender00 authored Mar 1, 2023
1 parent ef5f927 commit fa91706
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 7 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ A python package for Texas Hold 'Em Poker providing

| Version Name | Latest Tag | Release Notes | Patch Notes | Documentation | Release Date | End Support Date |
| ------------ | ---------- | ------------- | ----------- | ------------- | ------------ | ---------------- |
| 0.8 | v0.8.0 | [Release Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.8.0) | [Patch Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.8.0) | [Documentation](https://texasholdem.readthedocs.io/en/0.8/) | 6 November 2022 | |
| 0.7 | v0.7.2 | [Release Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.7.0) | [Patch Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.7.2) | [Documentation](https://texasholdem.readthedocs.io/en/0.7/) | 16 April 2022 | |
| 0.6 | v0.6.5 | [Release Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.6.0) | [Patch Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.6.5) | [Documentation](https://texasholdem.readthedocs.io/en/0.6/) | 24 March 2022 | 31 December 2022 |
| 0.5 | v0.5.3 | [Release Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.5.0) | [Patch Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.5.3) | [Documentation](https://texasholdem.readthedocs.io/en/0.5/) | 21 March 2022 | 31 December 2022 |
| 0.8 | v0.8.1 | [Release Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.8.0) | [Patch Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.8.1) | [Documentation](https://texasholdem.readthedocs.io/en/0.8/) | 6 November 2022 | |
| 0.7 | v0.7.3 | [Release Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.7.0) | [Patch Notes](https://github.com/SirRender00/texasholdem/releases/tag/v0.7.3) | [Documentation](https://texasholdem.readthedocs.io/en/0.7/) | 16 April 2022 | |

Current Roadmap \
[v1.0.0](https://github.com/SirRender00/texasholdem/wiki/Version-1.0.0-Roadmap)
Expand Down
7 changes: 7 additions & 0 deletions docs/changelog-0.7.3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Changes in 0.7.3
==========================

Fixes
------

- Fixes a bug where the random agent would not go ALL_IN even though it was a valid action.
7 changes: 7 additions & 0 deletions docs/changelog-0.8.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Changes in 0.8.1
==========================

Fixes
------

- Fixes a bug where the random agent would not go ALL_IN even though it was a valid action.
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.8.0'
release = 'v0.8.1'


# -- 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.8.0"
version = "0.8.1"
description = "A texasholdem python package"
authors = ["Evyn Machi <evyn.machi@gmail.com>"]
keywords = ['texasholdem', 'holdem', 'poker']
Expand Down
6 changes: 5 additions & 1 deletion texasholdem/agents/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@ def random_agent(game: TexasHoldEm, no_fold: bool = False) -> Tuple[ActionType,
possible.remove(ActionType.CHECK)

# not enough chips to raise
if max_raise < min_raise:
if not game.raise_option:
possible.remove(ActionType.RAISE)
elif max_raise < min_raise:
possible.remove(ActionType.RAISE)
if chips:
possible.append(ActionType.ALL_IN)

action_type, total = random.choice(possible), None
if action_type == ActionType.RAISE:
Expand Down

0 comments on commit fa91706

Please sign in to comment.