Skip to content

Commit

Permalink
First attempt at All in or Fold
Browse files Browse the repository at this point in the history
  • Loading branch information
ChazDazzle committed Oct 2, 2023
1 parent 60ee953 commit a362d10
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
1 change: 1 addition & 0 deletions pyfpdb/Card.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]),
Expand Down
13 changes: 11 additions & 2 deletions pyfpdb/Hand.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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']
Expand Down Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions pyfpdb/KingsClubToFpdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ class KingsClub(HandHistoryConverter):

re_Rake = re.compile(r"^Rake\s(?P<RAKE>[,.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])
Expand Down Expand Up @@ -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':
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit a362d10

Please sign in to comment.