A library to help with any Rust code dealing with poker. This includes card values, suits, hands, hand ranks, 5 card hand strength calculation, 7 card hand strength calulcation, and monte carlo game simulation helpers.
externcrate rs_poker;users_poker::core::Hand;users_poker::holdem::MonteCarloGame;fnmain(){let hands =["Adkh","8c8s"].iter().map(|s|Hand::new_from_str(s).expect("Should be able to create a hand.")).collect();letmut g =MonteCarloGame::new_with_hands(hands).expect("Should be able to create a game.");letmut wins:[u64;2]=[0,0];for_in0..2000000{let r = g.simulate().expect("There should be one best rank.");
g.reset();
wins[r.0]+=1}println!("Wins = {:?}", wins);}