Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update example in readme #15

Open
SimoMoilanen opened this issue Jul 29, 2023 · 0 comments
Open

Update example in readme #15

SimoMoilanen opened this issue Jul 29, 2023 · 0 comments

Comments

@SimoMoilanen
Copy link

Hi, the example on how to use Equity Calculator didn't work when I tried it. I made a couple of changes and this is how I got it to work:

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");
let stdev_target = 0.01;
let n_threads = 4;
let result = approx_equity(&ranges, public_cards, n_threads, stdev_target);
match result {
    Ok(equity) => { println!("player 1 equity: {}", equity[0]) }
    Err(error) => { println!("{}", error) }
};

I tried to open a PR, but push was blocked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant