#hand #poker #indexer #index #rust-poker #kevin #waugh

hand_indexer

由 Kevin Waugh 编写的 poker 手牌索引库的 Rust 接口

3 个版本

0.1.2 2021 年 2 月 25 日
0.1.1 2021 年 2 月 18 日
0.1.0 2020 年 8 月 27 日

模拟 中排名 #286


rust_poker 中使用

MIT 许可证

33KB
730

RustPoker

Build Status docs.rs crates.io

用 Rust 编写的扑克库。

  • 多线程范围与范围公平性计算
  • 快速手牌评估
  • 高效的手牌索引

安装

将此添加到您的 Cargo.toml

[dependencies]
rust_poker = "0.1.13"

注意:使用 rust_poker 的应用程序的第一次构建将需要额外的时间来生成手牌评估表

手牌评估器

使用最多 7 张牌评估任何扑克手牌的强度。

用法

use rust_poker::hand_evaluator::{Hand, CARDS, evaluate};
// cards are indexed 0->51 where index is 4 * rank + suit
let hand = Hand::empty() + CARDS[0] + CARDS[1];
let score = evaluate(&hand);
println!("score: {}", score);

公平性计算器

计算由 equilab-like 范围字符串指定的多达 6 个不同范围的范围对范围公平性。支持蒙特卡洛模拟和精确公平性计算

用法

use rust_poker::hand_range::{HandRange, get_card_mask};
use rust_poker::equity_calculator::approx_equity;
let ranges = HandRange::from_strings(["AK,22+".to_string(), "random".to_string()].to_vec());
let public_cards = get_card_mask("2h3d4c".to_string());
let stdev_target = 0.01;
let n_threads = 4;
let equities = approx_equity(&ranges, public_cards, n_threads, stdev_target);
println!("player 1 equity: {}", equities[0]);

贡献

手牌评估器和公平性计算器库是 zekyll 的 C++ 公平性计算器的 Rust 重写,OMPEval

许可证

此项目受 MIT 许可证许可

版权所有 © 2020 Kyle Murphy

无运行时依赖

~0–2.3MB
~45K SLoC