by kraada » Mon May 03, 2010 9:03 am
The easiest way to define a turn overcard would be:
holdem_hand_summary.card_1 % 13 > 0 and holdem_hand_summary.card_2 % 13 > 0 and holdem_hand_summary.card_3 % 13 > 0 and
((holdem_hand_summary.card_4 % 13 = 0) or (holdem_hand_summary.card_4 % 13 > holdem_hand_summary.card_1 % 13 and
holdem_hand_summary.card_4 % 13 > holdem_hand_summary.card_2 % 13 and holdem_hand_summary.card_4 % 13 > holdem_hand_summary.card_3 % 13))
First we check that there was no ace on the flop (card_x % 13 = 0 for aces, 1 for deuces, 2 for treys and so on), then if there was no ace on the flop we know the turn is an overcard if either the turn is an ace, or card_4 % 13 is larger than all three of the other cards.