Crates.io | rust_poker |
lib.rs | rust_poker |
version | 0.1.14 |
source | src |
created_at | 2020-07-16 04:28:52.393371 |
updated_at | 2021-03-04 00:58:39.218177 |
description | Rust poker library |
homepage | |
repository | https://github.com/kmurf1999/rust_poker |
max_upload_size | |
id | 265655 |
size | 96,212 |
A poker library written in rust.
Multithreaded range vs range equity calculation
Fast hand evaluation
Efficient hand indexing
Add this to your Cargo.toml
:
[dependencies]
rust_poker = "0.1.13"
Note: The first build of an application using rust_poker
will take extra time to generate the hand evaluation table
Evaluates the strength of any poker hand using up to 7 cards.
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);
Calculates the range vs range equities for up to 6 different ranges specified by equilab-like range strings. Supports monte-carlo simulations and exact equity calculations
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]);
The hand evaluator and equity calculator library is a rust rewrite of zekyll's C++ equity calculator, OMPEval
This project is MIT Licensed
Copyright (c) 2020 Kyle Murphy