Attached a standalone version of the code here, with a simple profiler running 10 mill random hands. Seems it only does 17M hands/s for me now, not sure if it's my compiler settings or if I did something wrong last time i tested it.
Didn't go through the comments, but guess they can be ignored for the most part :p
Quote:
Also if you dont mind sharing, how do you create ranges of cards, if you do? I mean for example from a string "AAhh:(23+,35+)", ie. PPT style. That is what I am working on now and it seems tougher than i thought.
Guess I could share code for this too, but don't think I'll do so publicly.
Anyway, I read in hands at a format similar to what you mentioned, creating Range-objects hierarchically, combined with
and or
or links. After connecting all the rules it feeds hands through the different Rule-filters, eventually storing the final range as Hand-objects in a vector.
In no way rocket science, but it allows for complex combination of rules and a fast final product.
I downloaded the code and the test with random hands looks good so far, however I am not sure what card each integer represents.
Is it like 0 = "2c", 1 = "2d", 2 = "2h", 3 = "2s", 4 = "3c" ...
0 = "2c", 1 = "3c", 2 = "4c", 3 = "5c", 4 = "6c" ...