Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frgfm/poker-buddy
Poker assistant project
https://github.com/frgfm/poker-buddy
card deck game game-theory player poker statistics texas-holdem
Last synced: about 1 month ago
JSON representation
Poker assistant project
- Host: GitHub
- URL: https://github.com/frgfm/poker-buddy
- Owner: frgfm
- License: mit
- Created: 2018-07-08T10:50:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-05T21:26:52.000Z (almost 6 years ago)
- Last Synced: 2024-12-05T17:48:28.433Z (2 months ago)
- Topics: card, deck, game, game-theory, player, poker, statistics, texas-holdem
- Language: Python
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Poker buddy
This repository hold the different parts of a poker assistant projects.## Installation
This project was only developed using Python and numpy.
```
git clone https://github.com/frgfm/poker-buddy.git
cd poker-buddy
pip install requirements.txt
```## Usage
If you prefer running the simulation directly without entering a shell:
```bash
python src/main.py
```If you favor using objects in Python, you can use the classes and functions from the game.py file
```python
from game import Player, Game, get_hand_value, get_winners
players = [Player() for k in range(4)]
g = Game(players)
g.deal()
g.hit()
g.hit()
g.hit()
hands = []
for k in range(4):
print('Player %s: %s' % (k, g.get_player_cards(k)))
hands.append(get_hand_value(g.community_cards + g.players[k].cards))
print(hands[-1])
print('Winner:', get_winners(hands))
```Either way, it should simulate a game with an output similar to:
```bash
Dealing cards to players...
Flop: ['9 Diamonds', '6 Diamonds', 'Q Diamonds']
Turn: ['9 Diamonds', '6 Diamonds', 'Q Diamonds', '3 Diamonds']
River: ['9 Diamonds', '6 Diamonds', 'Q Diamonds', '3 Diamonds', '2 Clubs']
Player 0: ['4 Spades', '10 Diamonds']
{'royal flush': None, 'straight flush': None, 'fours': [], 'full house': None, 'flush': 'Diamonds', 'straight': [], 'threes': [], 'double pairs': [], 'pairs': [], 'high': 10}
Player 1: ['5 Spades', 'A Spades']
{'royal flush': None, 'straight flush': None, 'fours': [], 'full house': None, 'flush': [], 'straight': [], 'threes': [], 'double pairs': [], 'pairs': [], 'high': 12}
Player 2: ['K Diamonds', '9 Spades']
{'royal flush': None, 'straight flush': None, 'fours': [], 'full house': None, 'flush': 'Diamonds', 'straight': [], 'threes': [], 'double pairs': [], 'pairs': [7], 'high': 11}
Player 3: ['J Spades', '10 Spades']
{'royal flush': None, 'straight flush': None, 'fours': [], 'full house': None, 'flush': [], 'straight': [], 'threes': [], 'double pairs': [], 'pairs': [], 'high': 10}
Winner: [2]
```## TODO
- [x] Model a Texas Holdem Poker game
- [ ] Live computation of odds of winning depending on each player's point of view
- [ ] Investigate card recognition from pictures
- [ ] Investigate Reinforcement Learning to capture player decision-making profile