Created
September 24, 2020 00:16
-
-
Save eddie-knight/4e4aaf1d5bc266aa0c1c15a1cc660699 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
class deck_builder(): | |
suit = [ | |
"A", "K", "Q", "J", | |
"10", "9", "8", | |
"7", "6", "5", | |
"4", "3", "2" | |
] | |
def __init__(self): | |
self.deck = [] | |
self.build() | |
def build(self): | |
for name in ["H", "S", "D", "C"]: | |
for card in self.suit: | |
self.deck.append(name + card) | |
def list(self): | |
return self.deck | |
def shuffle(self): | |
random.shuffle(self.deck) | |
def draw(self): | |
return self.deck.pop(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment