comparing cards

Discuss how to create custom stats, reports and HUD profiles and share your creations.

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

comparing cards

Postby socorrista5 » Thu Jul 26, 2012 3:01 pm

Hello,
sorry to make so many questions. I hope the statistics guide for PT4 will soon be ready, but meanwhile some questioon come to me when building stats, sorry :-(

My question is how to compare cards, for exaple:

my hole cards:
card 1= 7 hearts
card 2 = 7 diamonds

I fold my hand, but some other players keep in the hand, and the flop is:

flop:
card 1 = 9 diamonds
card 2 = 7 clubs
card 3 = J hearts

I would like to make a stat like this (in "human" languaje) without taking into account the suit:

If (hole_card_1 = flop_card_1 OR hole_card_1 = flop_card_2 OR hole_card_1 = flop_card_3) ......... this sentence would be TRUE if any of the 3 flop cards was a "7"

And this sentence I would like to make it even if I did FLOP preflop.

Can it be done?

Thanks, and sorry for making so many questions....
socorrista5
 
Posts: 142
Joined: Mon May 24, 2010 7:56 am

Re: comparing cards

Postby kraada » Thu Jul 26, 2012 3:44 pm

This can be done. Your cards are cash_hand_player_statistics.holecard_1 and cash_hand_player_statistics.holecard_2 (and 3 and 4 if you play omaha). The board cards are cash_hand_summary.card_1, cash_hand_summary.card_2 and cash_hand_summary.card_3 (4 and 5 are the turn and river respectively).

To compare them the easiest way to do this is to use this construction:

cash_hand_player_statistics.holecard_1 % 13

This strips the suit and gives you a number corresponding to your card rank. 0 is an ace, 1 is a deuce, 2 is a trey and so on. You can then compare:

cash_hand_player_statistics.holecard_1 % 13 = cash_hand_summary.card_1 % 13

There'll be quite a few comparisons but it will work. One thing though, if you're testing for aces you want to make sure that cash_hand_summary.card_1 > 0 - otherwise you'll always match for hands where there was no flop (because the card values are all 0). The reason for this is that the values start at 1 with the 2c and count up - leaving the aces as multiples of 13, hence giving 0 as the remainder when dividing by 13 - but they're always nonzero values in the database.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: comparing cards

Postby socorrista5 » Thu Jul 26, 2012 4:48 pm

OK, thanks a lot!
socorrista5
 
Posts: 142
Joined: Mon May 24, 2010 7:56 am


Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: No registered users and 14 guests

cron
highfalutin