remove debug code i accidently committed last time

account for dead seats between blinds
fix some improper position handling when BB in seat 2, with dead hand in seat 1, and SB on last seat
This commit is contained in:
eblade 2008-11-27 11:27:23 -05:00
parent 762ae46afb
commit 401bcc15cd

View File

@ -894,7 +894,7 @@ def parsePositions (hand, names):
if (bb!=-1): if (bb!=-1):
bb=recognisePlayerNo(bb, names, "bet") bb=recognisePlayerNo(bb, names, "bet")
print "sb = ", sb, "bb = ", bb # print "sb = ", sb, "bb = ", bb
if bb == sb: if bb == sb:
sbExists = False sbExists = False
sb = -1 sb = -1
@ -904,6 +904,7 @@ def parsePositions (hand, names):
positions[sb]="S" positions[sb]="S"
positions[bb]="B" positions[bb]="B"
#fill up rest of array #fill up rest of array
if (sbExists): if (sbExists):
arraypos=sb-1 arraypos=sb-1
@ -916,15 +917,24 @@ def parsePositions (hand, names):
arraypos-=1 arraypos-=1
distFromBtn+=1 distFromBtn+=1
### RHH - Changed to set the null seats before BB to "9" # eric - this takes into account dead seats between blinds
i=bb-1 if sbExists:
i = bb - 1
while positions[i] < 0 and i != sb:
positions[i] = 9
i -= 1
### RHH - Changed to set the null seats before BB to "9"
if sbExists:
i = sb-1
else:
i = bb-1
while positions[i] < 0: while positions[i] < 0:
positions[i]=9 positions[i]=9
i-=1 i-=1
arraypos=len(names)-1 arraypos=len(names)-1
if (bb!=0 or (bb==0 and sbExists==False)): if (bb!=0 or (bb==0 and sbExists==False) or (bb == 1 and sb != arraypos) ):
while (arraypos>bb): while (arraypos>bb and arraypos > sb):
positions[arraypos]=distFromBtn positions[arraypos]=distFromBtn
arraypos-=1 arraypos-=1
distFromBtn+=1 distFromBtn+=1
@ -934,7 +944,7 @@ def parsePositions (hand, names):
print "parsePositions names:",names print "parsePositions names:",names
print "result:",positions print "result:",positions
raise FpdbError ("failed to read positions") raise FpdbError ("failed to read positions")
print str(positions), "\n" # print str(positions), "\n"
return positions return positions
#end def parsePositions #end def parsePositions