zekyll / OMPEval

Fast C++ poker hand evaluator and equity calculator
ISC License
173 stars 69 forks source link

from Hands to CardRange #15

Open pabx06 opened 6 years ago

pabx06 commented 6 years ago

hello i am trying to evaluate equity for for a hands ie AcAd in holdem heads-up.

this code seem to works fine:

omp::EquityCalculator eq;
eq.start({"AcAd","random"},0,0,true,5e-5,nullptr,0.2,4);

But now i would like to use the AcAd hands as their numerical representation (4*Ranks+Suit) for "AcAd" it is [12,13]

how can i instantiate a CardRange from a Hand or an array of int ?

jfaure commented 6 years ago

CardRange(const std::vector<std::array<uint8_t,2>>& combos);

eg. std::vector<std::array<uint8_t, 2>> rangeUnsigned{{12, 13}}; omp::CardRange range(rangeUnsigned);

pabx06 commented 6 years ago

True. However how one would make for a 5,6,7 card(int) . I also had some strange equity results: i have similar equity results with hands that have a higher kicker vs the random hand ...

jfaure commented 6 years ago

If you want to create a 5/6/7 card hand, you should use the Hand type directly, CardRange is for synthesizing holecards. 'The random hand' is a bit of a misnommer, in actual fact it means the entire range of possible preflop holdings.