コード例 #1
0
def main():
    game = PokerGame.PokerGame()

    while True:

        getDeal(game)
        getDeal(game)
        print_game_state(game)
コード例 #2
0
def welcome():
    cards = [
        'AH', 'AC', 'AS', 'AD', '2S', '2C', '2H', '2D', '3D', '3C', '3H', '3S',
        '4S', '4D', '4C', '4H', '5S', '5D', '5C', '5H', '6S', '6D', '6C', '6H',
        '7S', '7D', '7C', '7H', '8S', '8D', '8C', '8H', '9S', '9D', '9C', '9H',
        'TS', 'TD', 'TC', 'TH', 'JS', 'JD', 'JC', 'JH', 'QS', 'QD', 'QC', 'QH',
        'KS', 'KD', 'KC', 'KH'
    ]

    user1_cards = []
    user2_cards = []
    user3_cards = []
    user4_cards = []

    random.shuffle(cards)

    for i in range(5):
        user1_cards.append(cards[i])

    for i in range(5, 10):
        user2_cards.append(cards[i])

    for i in range(10, 15):
        user3_cards.append(cards[i])

    for i in range(15, 20):
        user4_cards.append(cards[i])

        user1_cards.sort()
        user2_cards.sort()
        user3_cards.sort()
        user4_cards.sort()

    hands = [user1_cards, user2_cards, user3_cards, user4_cards]

    hand, Winner_Deck, player = PokerGame.poker(hands)

    return render_template('poker.html',
                           user1=user1_cards,
                           user2=user2_cards,
                           user3=user3_cards,
                           user4=user4_cards,
                           hand=hand,
                           Winner_Deck=Winner_Deck,
                           player=player)
コード例 #3
0
 def evaluateState(self, stateQueue):
     stateQueue.sort(
         key=lambda childState: (childState.nn_current_hand, childState.
                                 opponent.stack - childState.agent.stack))
     childStates = PokerGame.get_next_states(stateQueue.pop(0))
     return (childStates)
コード例 #4
0
 def evaluateState(self, stateQueue):
     return PokerGame.get_next_states(stateQueue.pop(-1))
コード例 #5
0
 def evaluateState(self, stateQueue):
     randIndex = np.random.randint(0, len(stateQueue))
     nextStates = PokerGame.get_next_states(stateQueue.pop(randIndex))
     return nextStates
コード例 #6
0
 def evaluateState(self, stateQueue):
     test = stateQueue.pop(0)
     return PokerGame.get_next_states(test)
コード例 #7
0
import PokerGame

game = PokerGame.PokerGame()

for i in range(3):
    hand = game.deal()
    game.playIntoHand(hand[0], 0, hand[1], 1)
game.print_board()

print(hand)
コード例 #8
0
 def evaluateState(self, stateQueue):
     stateQueue.sort(key=lambda childState: childState.nn_current_hand)
     childStates = PokerGame.get_next_states(stateQueue.pop(0))
     return childStates