Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/Hand Evaluator/HandEvaluator/PocketHands.cs b/Hand Evaluator/HandEvaluator/PocketHands.cs
- index 2bf5c76..8172f7b 100644
- --- a/Hand Evaluator/HandEvaluator/PocketHands.cs
- +++ b/Hand Evaluator/HandEvaluator/PocketHands.cs
- @@ -3958,7 +3958,7 @@ namespace HoldemHand
- static public PocketHands PocketCards169(string pocket)
- {
- PocketHands retval = new PocketHands();
- - if (pocket.Length == 3 && pocket[2] == '*')
- + if ((pocket.Length == 2 && pocket[0] != pocket[1]) || (pocket.Length == 3 && pocket[2] == '*'))
- {
- retval |= _Pocket169Combinations[(int)Pocket169(string.Format("{0}{1}s", pocket[0], pocket[1]))];
- @@ -4151,7 +4151,7 @@ namespace HoldemHand
- static public PocketHands PocketCards169Range(string s, string e)
- {
- Hand.PocketHand169Enum smin, smax, emin, emax;
- - if (s.Length == 3 && s[2] == '*')
- + if ((s.Length == 2 && s[0] != s[1]) || (s.Length == 3 && s[2] == '*'))
- {
- smin = Pocket169(string.Format("{0}{1}s", s[0], s[1]));
- smax = Pocket169(string.Format("{0}{1}o", s[0], s[1]));
- @@ -4161,7 +4161,7 @@ namespace HoldemHand
- smin = smax = Pocket169(s);
- }
- - if (e.Length == 3 && e[2] == '*')
- + if ((e.Length == 2 && e[0] != e[1]) || (e.Length == 3 && e[2] == '*'))
- {
- emin = Pocket169(string.Format("{0}{1}s", e[0], e[1]));
- emax = Pocket169(string.Format("{0}{1}o", e[0], e[1]));
- @@ -4193,21 +4193,16 @@ namespace HoldemHand
- static public PocketHands PocketCard169Range(Hand.PocketHand169Enum s, Hand.PocketHand169Enum e)
- {
- PocketHands retval = new PocketHands();
- - int start = (int) s, end = (int) e;
- - if (start > end)
- - {
- - for (int i = end; i <= start; i++)
- - {
- - retval |= _Pocket169Combinations[i];
- - }
- - }
- - else
- + int start = Math.Min((int)s, (int)e);
- + int end = Math.Max((int)s, (int)e);
- + // If the start and end are both suited or both offsuited, just return suited/offsuited pockets.
- + int interval = start > 12 && start % 2 == end % 2 ? 2 : 1;
- +
- + for (int i = start; i <= end; i += interval)
- {
- - for (int i = start; i <= end; i++)
- - {
- - retval |= _Pocket169Combinations[i];
- - }
- + retval |= _Pocket169Combinations[i];
- }
- +
- return retval;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement