def main(): """"Get the number of players, generate the deck of cards and work out the computer players risk.""" numberOfPlayers = int( input("Please enter the number of players, max is six")) deck = playingCard.generateDeck() deck = playingCard.shuffleCards(deck) hands = playingCard.dealCards(deck, 2, numberOfPlayers, []) computerRisk = initialiseComputerRisk(numberOfPlayers) blackJack(deck, hands, computerRisk)
def main(): deck = playingCard.generateDeck() deck = playingCard.shuffleCards(deck) print("We will play snap to match on suites") secondsToWait = int(input("Please enter the number of seconds to wait")) # The next function returns two hands of cards. It has a full deck of cards as an input. The number of cards to deal # is zero so all cards are dealt to the two players. The last parameter is an empty list since the players have not # already been dealt any cards. hands = playingCard.dealCards(deck, 0, 2, []) snap(hands,secondsToWait)
def main(): """ Get the number of players, generate the deck and play Sevens I think some of the logic in this is over-complicated but I'm glad to get it working with it's features """ num_of_players = get_num_players() deck = playingCard.generateDeck() deck = playingCard.shuffleCards(deck) hands = playingCard.dealCards(deck, 0, num_of_players, []) players = initiate_players(hands) table_hands = initiate_table_hand() sevens(players, table_hands)
def test_suffledDeck(self): deck = playingCard.generateDeck() firstCards = deck[0:5] deck = playingCard.shuffleCards(deck) self.assertTrue(self.notListEqual(firstCards, deck[0:5]))
def test_numberOfCardsInShuffledDeck(self): deck = playingCard.generateDeck() deck = playingCard.shuffleCards(deck) self.assertEqual(len(deck), numberOfCards)
def pokerDeck(): deck = playingCard.generateDeck() playingCard.shuffleCards(deck) return deck