need help with deciphering cash_hand_summary exprs

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

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

need help with deciphering cash_hand_summary exprs

Postby tiltmonster12 » Sun Aug 04, 2019 5:30 pm

what does this expression mean?

"(cash_hand_summary.card_1 - 1) % 13 =12"

The only thing i know is that it deals with a flop card.

Other questions are:
what does the "- 1" mean?
what does the percentage sign mean and do?

Could it have just been written:
"cash_hand_summary.card_1 = 13" ??
tiltmonster12
 
Posts: 18
Joined: Wed Jul 19, 2017 5:30 pm

Re: need help with deciphering cash_hand_summary exprs

Postby Flag_Hippo » Mon Aug 05, 2019 7:15 pm

cash_hand_summary.card_1 is the first card on the flop (2 and 3 are the following flop cards, 4 is the turn card and 5 is the river card) and the values of each specific card are summarised here so:

cash_hand_summary.card_1 = 13 (the first flop card is A :club: )

The percentage sign is a modulo which returns the remainder of a division so for example 12 divided by 5 would leave a remainder of 2 which would look like:

12 % 5 = 2

and since there are 13 cards in each suit % 13 maps each rank of card to a single number - aces are 0, deuces are 1 and so on. So if you wanted to test if the flop contained at least one King you would use:

cash_hand_summary.card_1 % 13 = 12 OR cash_hand_summary.card_2 % 13 = 12 OR cash_hand_summary.card_3 % 13 = 12

If you wanted to test for other board textures like K or higher flops then an ace is considered low since it's value after % 13 is 0. Therefore if you wanted to test for K or higher that needs:

cash_hand_summary.card_1 - 1

which changes the values of each card by minus 1 so Aces now have a value of 12, Kings 11, e.t.c. which means a King or higher flop looks like this:

(cash_hand_summary.card_1 - 1) % 13 >= 11 OR (cash_hand_summary.card_2 - 1) % 13 >= 11 OR (cash_hand_summary.card_3 - 1) % 13 >= 11
Flag_Hippo
Moderator
 
Posts: 15219
Joined: Tue Jan 31, 2012 7:50 am

Re: need help with deciphering cash_hand_summary exprs

Postby tiltmonster12 » Wed Aug 07, 2019 2:44 am

thank you for the explanation. I get how it works now but im kind of curious of how this code was created. If you dont mind me asking, what is the formula that would allow the program to understand what "cash_hand_summary.card_1 % 13 = 12" means?


Like what number was divided for it to get a mod of 1-12?
tiltmonster12
 
Posts: 18
Joined: Wed Jul 19, 2017 5:30 pm

Re: need help with deciphering cash_hand_summary exprs

Postby Flag_Hippo » Wed Aug 07, 2019 12:46 pm

PokerTracker 4 parses information in hand history files and then stores the resulting values in the database and this is stored in a program called PostgreSQL. Modulo is a standard mathematical operation which is supported in PostgreSQL along with other functions.
Flag_Hippo
Moderator
 
Posts: 15219
Joined: Tue Jan 31, 2012 7:50 am


Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: No registered users and 18 guests

cron