0

the calling ranges are stored in a function like this where KK+ means pocket pairs KK and better

const char* prw_preflop_ICMrange[] = { 
"AA+",
"KK+",
"KK+,AKs",
}

I would like to write a function that would remove the card combos of my own holding from opponents range e.g.:

I hold the "Ac8d" and opponents range is "KK+,AKs" then the function should loop through his calling range and remove 3 combos from AA and 1 combo from AKs. Likewise it should loop through all Ax and 8x hand possibilities and remove the combos that involve the Ac and 8d. The function should return an integer with my opponents actual calling range e.g.:
(16 combos - 4 combos)/(1326 combos - 101 combos) = 0.0098 (his calling range of 0.0121 is actually more narrow due to card removal)

How could you achieve something like this?

g3wtter
  • 13
  • 3

1 Answers1

0

Create a function that generates all combinations then use this function to populate instance of std::vector<std::string> with the values generated.

Use the pre-populated vector as input to functions that return the counts of combinations. The functions should not remove anything from the list, only count the occurrences where the conditions are met, since you are not interested in all combinations, rather in the number of the combinations.

In cases where you really want to have the combinations, the function should build a new vector and return it rather than deleting values from the vector.

jordanvrtanoski
  • 5,104
  • 1
  • 20
  • 29