Stove: Minor changes for GUI use
This commit is contained in:
parent
9c16365aac
commit
d5430b6bb5
|
@ -142,6 +142,7 @@ class SumEV:
|
||||||
self.n_wins = 0
|
self.n_wins = 0
|
||||||
self.n_ties = 0
|
self.n_ties = 0
|
||||||
self.n_losses = 0
|
self.n_losses = 0
|
||||||
|
self.output = ""
|
||||||
|
|
||||||
def add(self, ev):
|
def add(self, ev):
|
||||||
self.n_hands += ev.n_hands
|
self.n_hands += ev.n_hands
|
||||||
|
@ -153,13 +154,15 @@ class SumEV:
|
||||||
win_pct = 100 * (float(self.n_wins) / float(self.n_hands))
|
win_pct = 100 * (float(self.n_wins) / float(self.n_hands))
|
||||||
lose_pct = 100 * (float(self.n_losses) / float(self.n_hands))
|
lose_pct = 100 * (float(self.n_losses) / float(self.n_hands))
|
||||||
tie_pct = 100 * (float(self.n_ties) / float(self.n_hands))
|
tie_pct = 100 * (float(self.n_ties) / float(self.n_hands))
|
||||||
print 'Enumerated %d possible plays.' % self.n_hands
|
self.output = """
|
||||||
print 'Your hand: (%s %s)' % (hand.c1, hand.c2)
|
Enumerated %d possible plays.
|
||||||
print 'Against the range: %s\n' % cards_from_range(h_range)
|
Your hand: (%s %s)
|
||||||
print ' Win Lose Tie'
|
Against the range: %s
|
||||||
print ' %5.2f%% %5.2f%% %5.2f%%' % (win_pct, lose_pct, tie_pct)
|
Win Lose Tie
|
||||||
|
%5.2f%% %5.2f%% %5.2f%%
|
||||||
|
""" % (self.n_hands, hand.c1, hand.c2, cards_from_range(h_range), win_pct, lose_pct, tie_pct)
|
||||||
|
|
||||||
|
print self.output
|
||||||
|
|
||||||
|
|
||||||
# Expands hand abbreviations such as JJ and AK to full hand ranges.
|
# Expands hand abbreviations such as JJ and AK to full hand ranges.
|
||||||
|
@ -272,6 +275,7 @@ def odds_for_range(holder):
|
||||||
sev.add(e)
|
sev.add(e)
|
||||||
|
|
||||||
sev.show(holder.hand, holder.h_range.get())
|
sev.show(holder.hand, holder.h_range.get())
|
||||||
|
return sev
|
||||||
|
|
||||||
def usage(me):
|
def usage(me):
|
||||||
print """Texas Hold'Em odds calculator
|
print """Texas Hold'Em odds calculator
|
||||||
|
|
Loading…
Reference in New Issue
Block a user