Skip to content

Instantly share code, notes, and snippets.

@laat
Created September 28, 2011 15:45
Show Gist options
  • Save laat/1248284 to your computer and use it in GitHub Desktop.
Save laat/1248284 to your computer and use it in GitHub Desktop.
#evaluate hand
good_hand = False
if phase == 0:
if self.card_power[0] == 2:
good_hand = True
elif self.card_power[0] == 1 and self.card_power[1] > 7:
good_hand = True
elif self.card_power[0] >= 2:
good_hand = True
#place bet
bet = 0
if phase == 0 and good_hand and more == 0:
bet = self.gm.blind * 3
elif good_hand and random() > 0.5: #call
bet = more
elif good_hand and random() > 0.2: #raise
bet = self.gm.blind*3
#else fold/check
self.money -= bet
return bet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment