From a362d100847ba10724a51541ea71fce88b01bd8e Mon Sep 17 00:00:00 2001 From: Chaz Littlejohn Date: Mon, 2 Oct 2023 14:41:37 -0400 Subject: [PATCH] First attempt at All in or Fold --- pyfpdb/Card.py | 1 + pyfpdb/Hand.py | 13 ++++++++-- pyfpdb/KingsClubToFpdb.py | 10 ++++++-- .../Flop/AOF-PLO-USD-100-200-202308.txt | 25 +++++++++++++++++++ 4 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 pyfpdb/regression-test-files/cash/KingsClub/Flop/AOF-PLO-USD-100-200-202308.txt diff --git a/pyfpdb/Card.py b/pyfpdb/Card.py index d0ca69766..64df01273 100755 --- a/pyfpdb/Card.py +++ b/pyfpdb/Card.py @@ -53,6 +53,7 @@ '5_omaha8' : ('hold','omaha8','s', {'PREFLOP':0,'FLOP':1,'TURN':2,'RIVER':3}, 'RIVER', [(0,5)]), 'cour_hi' : ('hold','omaha','h', {'PREFLOP':0,'FLOP':1,'TURN':2,'RIVER':3}, 'RIVER', [(0,5)]), 'cour_hilo' : ('hold','omaha8','s', {'PREFLOP':0,'FLOP':1,'TURN':2,'RIVER':3}, 'RIVER', [(0,5)]), + 'aof_omaha' : ('hold','omaha','h', {'FLOP':0,'TURN':1,'RIVER':2}, 'RIVER', [(0,4)]), '5_studhi' : ('stud','holdem', 'h', {'SECOND': 0, 'THIRD': 1,'FOURTH': 2,'FIFTH': 3}, 'FIFTH', [(0,2),(0,3),(0,4),(0,5)]), 'razz' : ('stud', None, 'l', {'THIRD': 0,'FOURTH': 1,'FIFTH': 2,'SIXTH': 3,'SEVENTH': 4}, 'SEVENTH', [(0,3),(0,4),(0,5),(0,6),(0,7)]), 'studhi' : ('stud','7stud', 'h', {'THIRD': 0,'FOURTH': 1,'FIFTH': 2,'SIXTH': 3,'SEVENTH': 4}, 'SEVENTH', [(0,3),(0,4),(0,5),(0,6),(0,7)]), diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index e7a47beb0..61475b842 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -707,7 +707,9 @@ def addBlind(self, player, blindtype, amount): street = 'BLAH' - if self.gametype['base'] == 'hold': + if self.gametype['category'] == 'aof_omaha': + street = 'FLOP' + elif self.gametype['base'] == 'hold': street = 'PREFLOP' elif self.gametype['base'] == 'draw': street = 'DEAL' @@ -1098,6 +1100,11 @@ def __init__(self, config, hhc, sitename, gametype, handText, builtFrom = "HHC", self.discardStreets = ['PREFLOP'] self.communityStreets = ['FLOP', 'TURN', 'RIVER'] self.actionStreets = ['BLINDSANTES','PREFLOP','FLOP','TURN','RIVER'] + if gametype['category']=='aof_omaha': + self.allStreets = ['BLINDSANTES','FLOP','TURN','RIVER'] + self.holeStreets = ['FLOP'] + self.communityStreets = ['FLOP', 'TURN', 'RIVER'] + self.actionStreets = ['BLINDSANTES','FLOP','TURN','RIVER'] Hand.__init__(self, self.config, sitename, gametype, handText, builtFrom = "HHC") self.sb = gametype['sb'] self.bb = gametype['bb'] @@ -1157,7 +1164,9 @@ def addShownCards(self, cards, player, shown=True, mucked=False, dealt=False, st if shown: self.shown.add(player) if mucked: self.mucked.add(player) else: - if len(cards) in (2, 3, 4, 6) or self.gametype['category'] in ('5_omahahi', '5_omaha8', 'cour_hi', 'cour_hilo'): # avoid adding board by mistake (Everleaf problem) + if self.gametype['category'] == 'aof_omaha': + self.addHoleCards('FLOP', player, open=[], closed=cards, shown=shown, mucked=mucked, dealt=dealt) + elif len(cards) in (2, 3, 4, 6) or self.gametype['category'] in ('5_omahahi', '5_omaha8', 'cour_hi', 'cour_hilo'): # avoid adding board by mistake (Everleaf problem) self.addHoleCards('PREFLOP', player, open=[], closed=cards, shown=shown, mucked=mucked, dealt=dealt) elif len(cards) == 5: # cards holds a winning hand, not hole cards # filter( lambda x: x not in b, a ) # calcs a - b where a and b are lists diff --git a/pyfpdb/KingsClubToFpdb.py b/pyfpdb/KingsClubToFpdb.py index 7c3b4f3fa..05bb2171b 100644 --- a/pyfpdb/KingsClubToFpdb.py +++ b/pyfpdb/KingsClubToFpdb.py @@ -201,6 +201,7 @@ class KingsClub(HandHistoryConverter): re_Rake = re.compile(r"^Rake\s(?P[,.0-9]+)$", re.MULTILINE) re_Split = re.compile(r"\*\*\* BOARD 1 - FLOP \*\*\*") + re_AOF = re.compile(r"Table '\w+? AOF \w+?'") def compilePlayerRegexs(self, hand): players = set([player[1] for player in hand.players]) @@ -266,9 +267,13 @@ def determineGameType(self, handText): m2 = self.re_Split.search(handText) if m2: - info['split'] = True + info['split'] = True else: info['split'] = False + + m3 = self.re_AOF.search(handText) + if m3: + info['category'] = 'aof_omaha' if info['limitType'] == 'fl' and info['bb'] is not None: if info['type'] == 'ring': @@ -534,7 +539,8 @@ def readHoleCards(self, hand): newcards = [x for x in found.group('NEWCARDS').split(' ') if x != 'X'] if len(newcards)>0: hand.hero = found.group('PNAME') - hand.addHoleCards(street, hand.hero, closed=newcards, shown=False, mucked=False, dealt=True) + _street = 'FLOP' if hand.gametype['category'] == 'aof_omaha' else street + hand.addHoleCards(_street, hand.hero, closed=newcards, shown=False, mucked=False, dealt=True) for street, text in hand.streets.iteritems(): if not text or street in ('PREFLOP', 'DEAL'): continue # already done these diff --git a/pyfpdb/regression-test-files/cash/KingsClub/Flop/AOF-PLO-USD-100-200-202308.txt b/pyfpdb/regression-test-files/cash/KingsClub/Flop/AOF-PLO-USD-100-200-202308.txt new file mode 100644 index 000000000..59be5a0f2 --- /dev/null +++ b/pyfpdb/regression-test-files/cash/KingsClub/Flop/AOF-PLO-USD-100-200-202308.txt @@ -0,0 +1,25 @@ +#7071017: Pot Limit Omaha - 100/200 +2023-08-14 02:22:40 +Table 'MAD AOF PLO' Seat 3 is the button +Seat 1: Nich B (1,000) +Seat 2: Christo A. (1,000) +Seat 3: Brian Str (1,000) +Nich B: posts the small blind 100 +Christo A.: posts the big blind 200 +*** HOLE CARDS *** +Dealt to Nich B: [9c 9d Kh Jh] +Dealt to Christo A.: [X X X X] +Dealt to Brian Str: [X X X X] +*** FLOP *** [Ah Qd Tc] +Brian Str folds +Nich B raises to 1,000, and is all in +Christo A. calls 1,000, and is all in +Nich B shows [9c 9d Kh Jh] +Christo A. shows [Qh Kd As 9s] +*** RIVER *** [Ah Qd Tc Qs] [8c] +*** SUMMARY * ** +Seat 1: Nich B (0) -1,000 +Seat 2: Christo A. (1,992) +992 +Seat 3: Brian Str (1,000) +Rake 8 +Christo A. wins pot (1,992) \ No newline at end of file