Crates.io | pokerhandrange |
lib.rs | pokerhandrange |
version | 0.1.1 |
source | src |
created_at | 2015-09-11 11:50:35.023047 |
updated_at | 2015-12-18 21:42:34.138314 |
description | Texas Hold'em hand ranges. Tells you if two cards are in them and can be used to generate card combinations. |
homepage | https://github.com/th4t/pokerhandrange-rs |
repository | |
max_upload_size | |
id | 3030 |
size | 28,215 |
#pokerhandrange-rs
There is an example application which makes use of them to let two ranges compete against each other. The crate defines a Range trait and contains a SimpleRange, which can be used to create a range representation with new_from_string("AA,AK+"), where the string can differ. The resulting SimpleRange can be used to check if any two cards are contained by it or to draw sample cards from it.
The crate is called pokerhandrange
and you can depend on it via cargo:
[dependencies.pokerhandrange]
git = "https://github.com/th4t/pokerhandrange-rs.git"
Possible "kinds" of range describing components:
Potentionally useful, but missing:
##About the example application This particular application is not accurate for several reasons, some obvious (one of them is described below) and some more sneaky. The approach will not scale to three or more hands. It works in the following way: two hand ranges are specified through strings at the beginning and then cards are repeatedly drawn from them, community cards are dealt and the strength of each hand is evaluated. Thousands of times. Stats are printed out at the end.
As an example of a statistical error that is able to skew the results: one narrower handrange is capable of dominating the other if they overlap on each occasion when the narrower one is assembled first and we insist on non-overlapping hole cards. Thanks to the "hole cards must be different, always" check. This approach will work even worse for 3+ competing ranges.
##TODOs