Exemplo n.º 1
0
    def __init__(self, number_of_players: int = 2, number_of_decks: int = 1):
        self.__player_list = []
        self.__main_deck = cardobjects.DealerDeck()
        self.__main_deck.makedeck(number_of_decks)
        self.__main_deck.shufflecards()
        self.__battlefield = Battlefield(number_of_players)
        self.__winner = 0
        self.__active_players = number_of_players

        if not (1 < number_of_players < 11):
            print("You can only have between 2 and 10 players. \n")
            raise ValueError()
        if not (0 < number_of_decks < 6):
            print("You can only have between 1 and 5 decks. \n")
            raise ValueError()

        for player_num in range(number_of_players):
            self.__player_list.append(Player(player_num))

        self.__deal_cards(self.__main_deck, self.__player_list)
Exemplo n.º 2
0
pokerhands2 = {
    "High Card": 0,
    "Two Kind": 0,
    "Two Pair": 0,
    "Three Kind": 0,
    "Straight": 0,
    "Flush": 0,
    "Full House": 0,
    "Four Kind": 0,
    "Straight Flush": 0
}

# Initialize variables and create objects
mypokerhand1 = ""
mypokerhand2 = ""
dealer = cardobjects.DealerDeck()
hand1 = cardobjects.PlayerHand()
hand2 = cardobjects.PlayerHand()
dealer.makedeck(decks)

# Print Header and start
print(f"Dealing {rounds} rounds:")
print("========================")
print()
for trials in range(0, rounds):
    dealer.shufflecards()

    # Deal Cards
    for cards in range(0, 5):
        hand1.addcard(dealer.takecard())
        hand2.addcard(dealer.takecard())
Exemplo n.º 3
0
def create_decks(deck_count: int):
    all_decks = cardobjects.DealerDeck()
    all_decks.makedeck(decks=deck_count)
    all_decks.shufflecards()
    return all_decks
Exemplo n.º 4
0
import cardobjects


def card_colors(deck):
    pass


one_deck = cardobjects.DealerDeck()
one_deck.makedeck()
one_deck.shufflecards()
player1 = cardobjects.PlayerHand()
player2 = cardobjects.PlayerHand()
compare = cardobjects.PlayerHand()

for loop in range(3):
    player1.addcard(one_deck.takecard())

for loop in range(3):
    player2.addcard(one_deck.takecard())

player1.showcards()

player2.showcards()