https://github.com/lostella/podds
Poker odds evaluation tool, written in C, multi-threaded
https://github.com/lostella/podds
c command-line multithread odds odds-calculator poker texas-holdem
Last synced: 10 months ago
JSON representation
Poker odds evaluation tool, written in C, multi-threaded
- Host: GitHub
- URL: https://github.com/lostella/podds
- Owner: lostella
- Created: 2013-10-18T13:45:32.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2023-05-30T09:16:24.000Z (over 2 years ago)
- Last Synced: 2025-04-06T10:54:06.234Z (10 months ago)
- Topics: c, command-line, multithread, odds, odds-calculator, poker, texas-holdem
- Language: C
- Homepage:
- Size: 59.6 KB
- Stars: 14
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Podds
[](https://travis-ci.org/lostella/podds)
`podds` is a command line tool to compute the probability of winning a (Texas hold 'em) poker round, given the number of players and the available cards.
Probabilities are estimated by sampling random games given the available information.
## Usage
To compile the program simply navigate to its directory and type `make`.
To run the program invoke
```
./podds
[ ... ]
```
Here `` is the **total** number of players, `
` and `` are the hole cards (mandatory arguments), while `` to `` are the community cards (optional, you can specify 0 to 5 of them).
Each card is represented by a **case sensitive** 2-characters string, according to the following convention:
* `2` to `9` = cards from 2 to 9
* `T` = 10
* `J`, `Q`, `K`, `A` = jack, queen, king, ace
* `h`, `d`, `c`, `s` = hearts, diamonds, clubs, spades
**Examples:** the ace of spades is `As`, the 10 of diamonds is `Td` and the 4 of clubs is `4c`.
The results are written onto `stdout`, and error messages (such as when arguments are not correctly formatted) are written to `stderr`. This way `podds` can be easily used from a higher-level interface. The output has the form: `:` and is supposed to be self-descriptive.Typical command-line interactions look as follows:
```
bash$ ./podds 5 Ts 9d Js 8h 3c
cores:4
games:200000
win:0.315
draw:0.031
pair:0.367
two-pairs:0.083
three-of-a-kind:0.014
straight:0.314
flush:0.000
full-house:0.000
four-of-a-kind:0.000
straight-flush:0.000
```
```
bash$ ./podds 4 Kd Jd Qs Tc Qd
cores:4
games:200000
win:0.406
draw:0.045
pair:0.291
two-pairs:0.290
three-of-a-kind:0.051
straight:0.301
flush:0.039
full-house:0.025
four-of-a-kind:0.001
straight-flush:0.002
```
## TODO
* Implement some options (e.g.: how many cores to use, how many games to simulate).
* Find a smart way to determine the default number of games to be simulated (e.g.: bounding the probability that results are inaccurate above some threshold).
* Implement interactive mode (where inputs are taken from `stdin`).
* Store results in a table (at least for short combos).
* Make available as a library (shared object).