Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zxch3n/texas-odds
Texas Hold'em Odds Calculator
https://github.com/zxch3n/texas-odds
Last synced: 21 days ago
JSON representation
Texas Hold'em Odds Calculator
- Host: GitHub
- URL: https://github.com/zxch3n/texas-odds
- Owner: zxch3n
- Created: 2023-01-26T19:09:03.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-27T18:27:56.000Z (almost 2 years ago)
- Last Synced: 2024-10-04T14:40:51.773Z (about 1 month ago)
- Language: Rust
- Homepage: https://texas-odds.vercel.app/
- Size: 107 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Texas Hold'em Odds Calculator
德州扑克胜率计算器
[**Try it online**](https://texas-odds-aah9.vercel.app/)
(A hobby project just for fun 🦀)
## CLI Usage
> Currently you need to install rust and clone this project to run the code
```
Texas Hold'em odds calculatorUsage: texas-odds [OPTIONS] [COMMUNITY_CARDS]...
Arguments:
Your cards no.1 -- 手牌 1
Your cards no.2 -- 手牌 2[COMMUNITY_CARDS]...
The community cards -- 公开池It should be empty or at least 3 cards.
Input format:
> h2 d3 s4 c5 d13
- hole_cards = [♥️2, ♦️3]
- community_cards = [♠️4, ♣️5, ♦️K]
h = hearts 红心 ♥️ , d = diamonds 方块 ♦️, s = spades 黑桃 ♠️, c = clubs 梅花 ♣️
Options:
-n, --n-players
The number of players (default = 2)-h, --help
Print help (see a summary with '-h')-V, --version
Print version
```**`cargo run -r HK DA`**
- my cards: [ ♥️K, ♦️A, ]
- public cards: []**`cargo run -r HK DA H3 C4 S10`**
- my cards: [ ♥️K, ♦️A, ]
- public cards: [ ♥️3, ♣️4, ♠️10, ]**`cargo run -r 1K 2A 33 44 12 13`**
- my cards: [ ♥️K, ♦️A, ],
- public cards: [ ♣️3, ♠️4, ♥️2, ♥️3, ],**Example Output**
```log
> cargo run -r SK HA D10 CJ C12 -n 88 Players
hole_cards: [♠️K, ♥️A], community_cards: [♦️10, ♣️J, ♣️Q]
win: 36.74%, tie: 30.09%
hand_rate: {Straight: 1.0}
``````log
> cargo run -r SK HA D10 CJ C8 -n 88 Players
hole_cards: [♠️K, ♥️A], community_cards: [♦️10, ♣️J, ♣️8]
win: 11.48%, tie: 1.29%
hand_rate: {
HighCard: 0.2960222016651249,
Pair: 0.42738205365402404,
TwoPair: 0.08325624421831637,
ThreeOfAKind: 0.013876040703052728,
Straight: 0.17946345975948197,
}
``````log
> cargo run -r S1 HK -n 33 Players
hole_cards: [♠️A, ♥️K], community_cards: []
win: 35.80%, tie: 0.03%
hand_rate: {
HighCard: 0.5355102040816326,
Pair: 0.40408163265306124,
TwoPair: 0.04040816326530612,
ThreeOfAKind: 0.015714285714285715,
Straight: 0.0032653061224489797,
FullHouse: 0.0009183673469387755,
FourOfAKind: 0.00010204081632653062,
}
```