SimonTheChain / deck_of_cards

A module to create and interact with a deck of cards object.
https://pypi.org/project/deck-of-cards/
5 stars 4 forks source link

Is there a way to force a deck out of the deck? #5

Closed OakandRocks closed 2 years ago

OakandRocks commented 2 years ago

I coded some blackjack stuff for fun but I can't seem to hit two A's, not sure if i'm just unlucky or if something's buggy.

I need to force a specific card.value (1) onto an object/list

SimonTheChain commented 2 years ago

You could try to empty the deck (if needed) with give_random_card(), give_first_card() or give_last_card(), then insert the cards you want into the deck:

card = deck_of_cards.Card((2, 11)) # 2=suit, 11=rank deck_obj.take_card(card)

But the easiest way to verify what you want is to print out the deck: deck_obj.print_deck()