Author Topic: Detecting cards of same value across 4 poker hands.  (Read 7220 times)

Tags:
  • All members
  • Posts: 31
Hi,
I can't seem to find this subject discussed anywhere on the forums, so here goes...

On exchange poker, I would like to detect the following occurring within the hole cards (i.e. within all four hands on the preflop):

The presence of three cards of the same value, e.g.:
  Hand 1:  As 9d
  Hand 2:  9c  Jc
  Hand 3:  Ks 4d
  Hand 4:  9s 3s

The presence of two lots of two cards of the same value, e.g.:
  Hand 1:  As 9d
  Hand 2:  9c  Jc
  Hand 3:  Ks 4d
  Hand 4:  Js 3s

I've looked through the standard functions and can't seem to find anything obvious.

Thanks in advance!

  • All members
  • Posts: 905
Re: Detecting cards of same value across 4 poker hands.
« Reply #1 on: 12 Jan 2013, 13:59 »
You need to construct your own Trigger Expressions to achieve this.
If you tell me what you hands you want to back/lay after detecting those conditions and why, then I will be able to help you further.

  • All members
  • Posts: 31
Re: Detecting cards of same value across 4 poker hands.
« Reply #2 on: 12 Jan 2013, 18:44 »
Hi rubold,
Thank you for your kind assistance. To put things into context, I already have a trigger set up to perform the necessary back/lay activity based on a number of conditions I have defined, and I'm adding this in, so all I'm looking for from this is for a function (presumably defined as a set of conditions within a block) to return 'true' if either of the described tests are met, and 'false' otherwise.

I hope you're still able to help?

Many thanks.

  • All members
  • Posts: 905
Re: Detecting cards of same value across 4 poker hands.
« Reply #3 on: 12 Jan 2013, 19:34 »

Do the 3 cards of same rank in your first example need to be in 3 different hands?

  • All members
  • Posts: 31
Re: Detecting cards of same value across 4 poker hands.
« Reply #4 on: 12 Jan 2013, 19:42 »
No - they can be anywhere in the 8 hole cards (same applies to the test for 2x2 cards of the same rank).

  • All members
  • Posts: 905
Re: Detecting cards of same value across 4 poker hands.
« Reply #5 on: 12 Jan 2013, 19:56 »
OK for the first test:

Trigger Expression s_1_card_1_outs is equal to 1
or Trigger Expression s_2_card_1_outs is equal to 1
or Trigger Expression s_3_card_1_outs is equal to 1
or Trigger Expression s_4_card_1_outs is equal to 1
or Trigger Expression s_1_card_2_outs is equal to 1
or Trigger Expression s_2_card_2_outs is equal to 1
or Trigger Expression s_3_card_2_outs is equal to 1
or Trigger Expression s_4_card_2_outs is equal to 1

This block will return True if any 3 cards are the same rank.  It will still return true if you have 2 or more sets of triplicate cards - this will be difficult to eliminate.

The other one will be similar, but test this first in your triggers and let me know the outcome.

  • All members
  • Posts: 31
Re: Detecting cards of same value across 4 poker hands.
« Reply #6 on: 13 Jan 2013, 18:48 »
Thanks rubold.
I'll run it through some tests ASAP and let you know how it goes. Just so I understand things, from what I can infer from the XFeeder help files, s_n_card_m_outs is defined as the following:

s_n = nth selection (this is a hand selection presumably?)
card_m = mth highest card of the selection (e.g. card_1 = highest card, card_2 = second highest card)
outs = number of cards of the selected value left in the deck

So the routine is checking each card of each hand to see if there is only 1 card of that value left in the deck, and if that is true, then by inference this means that 3 must have been dealt.

A couple more questions for you:

1) How does card_m handle cards of the same value?

2) Does the use of s_n always mean that the nth hand is being selected for that expression (i.e. there is no impact of any previous selection being made as part of an action in a block)?
For instance, If I have already made a selection (e.g. 2nd favourite) as part of an action and I am including this test in the 'conditions' for whether or not I do anything with the 2nd favourite in that block, will s_1 always refer to hand 1, and s_4 always refer to hand 4? Do you think I would be better off creating a user variable in a separate block to combine with the conditions when making my selection? Hope that makes sense!

UPDATE: I've run some tests and it seems to work as expected, and it also looks like it has answered my questions. Thank you rubold. I've been thinking about the second condition test to see if I can have a go at that myself, but I'm not sure if it will be as straightforward as these rules, since using '..._outs is equal to 2' means that a single pair of identical values will make the condition true. Will it require use of a variable to count the number of occurrences when a test for '..._outs is equal to 2', then set the condition true if the count > 1..? Thanks again in advance!

  • All members
  • Posts: 905
Re: Detecting cards of same value across 4 poker hands.
« Reply #7 on: 14 Jan 2013, 18:56 »
You should be able to achieve your second test with 8x set user variable triggers:

Set user variable count = count +1
Exactly in Round 2

Conditions:
Trigger Expression s_1_card_1_outs is equal to 2

Set user variable count = count+1

Conditions:
Trigger Expression s_1_card_2_outs is equal to 2

And reset the variable to 0 in Round 1.

  • All members
  • Posts: 31
Re: Detecting cards of same value across 4 poker hands.
« Reply #8 on: 17 Jan 2013, 22:05 »
Thanks again for your help rubold - I've learned a lot about x-feeder..!

  • All members
  • Posts: 31
Re: Detecting cards of same value across 4 poker hands.
« Reply #9 on: 19 Jan 2013, 09:49 »
One more question for you (or anyone really)...

What is the easiest method of determining if a selection's total hole card values are the highest total of all dealt hands?

I've used the condition 'Selection's Cards is the maximum overall', but this does not work as I think (from reading the help files) this refers to the number of cards dealt, rather than their values.

One would initially think it should be possible by a standard function, but I get the feeling it might only be possible via the use of user variables..?

  • All members
  • Posts: 905
Re: Detecting cards of same value across 4 poker hands.
« Reply #10 on: 19 Jan 2013, 11:43 »
I think you would need 4 triggers  to set a user variable to the hand index that returned true.

Arithmetic can be performed on card values by enclosing the expressions in curly brackets.

So:

Set user Variable  (Variable Name)   Value: sel_index
Exactly in Round 2  First Matching Selection

Any selections Index is equal to 1
AND Trigger Expression {card_1+card_2} is greater than {s_2_card_1+s_2_card_2}
AND Trigger Expression {card_1+card_2} is greater than {s_3_card_1+s_3_card_2}
AND Trigger Expression {card_1+card_2} is greater than {s_4_card_1+s_4_card_2}

Set user Variable  Value: sel_index
Exactly in Round 2  First Matching Selection

Any selections Index is equal to 2
AND Trigger Expression {card_1+card_2} is greater than {s_1_card_1+s_1_card_2}
AND Trigger Expression {card_1+card_2} is greater than {s_3_card_1+s_3_card_2}
AND Trigger Expression {card_1+card_2} is greater than {s_4_card_1+s_4_card_2}

etc...

If 2 hands had the same value then all condition blocks would be false and the variable would not be changed from its previous value. Again remember to reset the variable to 0 in Round 1.

  • All members
  • Posts: 31
Re: Detecting cards of same value across 4 poker hands.
« Reply #11 on: 23 Jan 2013, 23:20 »
Once again, thank you rubold. Learning X-Feeder would take a LOT longer if there weren't kind people like you to help out!

 

Please note, BetFair is seems to be currently OFFLINE