def pre_flop(): global game remaining = game.getRemaining() if len(remaining) == 1: return #print "pre_flop" for player in game.getPlayers(): if player.blind or not player.in_game: continue #betting.pre_flop_betting(player, table) betting.evaluateHand(game, player) for player in game.getPlayers(): if not player.in_game: continue remaining = game.getRemaining() #print "Players remaining:", len(remaining) if len(remaining) > 1: betting.evaluateHand(game, player) #betting.pre_flop_betting(player, table) else: game.finished=True player_won(player) break for player in remaining: if player.bet != game.getTable().get_bet(): bet()
def bet(): action = "" global game if game.getLenRemaining() == 1: return print "bet" for player in game.getPlayers(): if not player.in_game: continue remaining = game.getRemaining() if len(remaining) > 1: tablecards = game.getTable().get_cards() hand = player.get_hand() + tablecards hand_power = find_hand(cards.calc_cards_power(hand)) print "Player", player.no, "has", hand_power + str(cards.calc_cards_power(hand)) action = betting.evaluateHand(game, player) addContext(player, action) print "#####", player.hs else: game.finished = True player_won(player) remaining = game.getRemaining() for player in remaining: if player.bet != game.getTable().get_bet(): bet()
def bet(game): if len(find_remaining(players)) == 1: return for player in players: if player.in_game == False: continue remaining = find_remaining(players) if len(remaining) > 1: tablecards = table.get_cards() hand = player.get_hand() + tablecards hand_power = find_hand(cards.calc_cards_power(hand)) betting.evaluateHand(player, table, cards.calc_cards_power(hand)) else: game.finished = True player_won(player) remaining = find_remaining(players) for player in remaining: if player.bet != table.bet: bet(game)
def pre_flop(): global game remaining = game.getRemaining() if len(remaining) == 1: return #print "pre_flop" for player in game.getPlayers(): if player.blind or not player.in_game: continue #betting.pre_flop_betting(player, table) context = str(game.state) + str(len(remaining)) + str(pot_odds(game.table, player)) action = betting.evaluateHand(game, player) print action, game.table.bet player.contexts[context+action] = 0 remaining = game.getRemaining() for player in remaining: if player.bet != game.getTable().get_bet(): bet()
def bet(): global game remaining = game.getRemaining() if len(remaining) == 1: return print "bet" for player in remaining: if len(remaining) > 1: tablecards = game.getTable().get_cards() hand = player.get_hand() + tablecards hand_power = find_hand(cards.calc_cards_power(hand)) print "Player", player.no, "has", hand_power + str(cards.calc_cards_power(hand)) context = str(game.state) + str(len(remaining)) + str(pot_odds(game.table, player)) action = betting.evaluateHand(game, player) print action, game.table.bet player.contexts[context+action] = 0 remaining = game.getRemaining() else: game.finished = True player_won(player) remaining = game.getRemaining() for player in remaining: if player.bet != game.getTable().get_bet(): bet()